In your "count spaces method" before the for loop, you want to declare an int variable (let's call it spc)
then, each time you find that charat, spc++.
also, the string must be declared in the main method, not the spaces count method.
The actual code:
public class CountSpaces{
public static void main(String[] args){
String instring = "(your quote here)";
int spaces = calculateSpaces(instring);
System.out.println("The number of spaces is " + spaces);
}
public static int calculateSpaces(String in){
int spc = 0;
for(int i= 0; i<in.length; i++){
if(in.charAt(i)== ' '){
spc++;
}
}
return spc;
}
}
that should be it. If you have any questions, feel free to reach out.
L1 Cache
There other cache levels but the most frequently used data is put in L1d (d for data) and L1i (i for instructions).
<span>The process of using or controlling two or more windows at a time is known as multitasking.</span>
We need more information for this one, please.
Using the knowledge of pseudocodes it is possible to organize the stock of a store with the correct amount of blankets.
<h3>Writing the code in pseudocode we have:</h3>
<em>int blanket_info(30)</em>
<em>int blanket_disc,size_blanket,i,j;</em>
<em>for (i=0;i<n;i++){</em>
<em>insert the discription of every blanket (blanket_disc);</em>
<em>}</em>
<em>for(j=0;j<n;j++){</em>
<em>insert the size of blanket (size_blanket);</em>
<em>}</em>
<em>return arr [ ][ ];</em>
<em>int print_list()</em>
<em>end;,</em>
See more about pseudocode at brainly.com/question/13208346
#SPJ1