Answer:
settings>Accessibility>Touch>AssistiveTouch>Turn off
Explanation:
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.