2/13 For loop


#1

public class For {
public static void main(String[] args) {

	for (int waterlevel = 0; waterLevel < 7; waterLevel++) {

		System.out.println("The pool's water level is at " + waterLevel + " feet.");

	}
	
}

}

For.java:4: error: cannot find symbol
for (int waterlevel = 0; waterLevel < 7; waterLevel++) {
^
symbol: variable waterLevel
location: class For
For.java:4: error: cannot find symbol
for (int waterlevel = 0; waterLevel < 7; waterLevel++) {
^
symbol: variable waterLevel
location: class For
For.java:6: error: cannot find symbol
System.out.println("The pool's water level is at " + waterLevel + " feet.");
^
symbol: variable waterLevel
location: class For
3 errors


#2

check spelling

int waterlevel // should be waterLevel


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.