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.
Answer:
2.5 = float
'2.5' = str
3 = int
Explanation:
The data type: "float" is used for positive or negative decimals.
The data type: "str" is used for a sequence of letters, numbers, or symbols. Since the decimal used apostrophes, this means it's a character literal.
The data type: "int" is used for any positive or negative whole number.
The answer is <span>0.693 . </span><span>When a switch is closed, completing an LR series circuit, the time needed for the current to reach one half its maximum value is 0.693
</span>e^(-t/T) = 0.5
<span>-t/T = ln(0.5) = -0.693 </span>
I believe the answers would be A and B. Because you have to fulfill Chantelle's wishes and you have to access their data. Which I am guessing would require a database backup.
I hope this helps.