Coding Club
Eagle Ridge Middle School
Akash Pamal
Session 5
Today’s Talk
What is a while loop?
While (number >= 1){
Number = number/2;
Count++
}
Chaining - if / else
int a = 20;
if (a > 0) {� System.out.println("A is a positive number");�} else if (a < 0) {
System.out.println("A is a negative number");
} else {
System.out.println("I am not sure what A is");
}
Java Library APIs
Java Library APIs
While Loop
int a = 1;
while (as long as the condition is true) {� System.out.println("Value of a is " + a);
a = a + 1;�}
System.out.println("Finished the while loop”);
While Loop
int a = 1;
while (a < 10) {� System.out.println("Value of a is " + a);
a = a + 1;�}
Practice Problem
Practice Problem
Thank You