

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An example of java code demonstrating the use of conditional statements (if-else) and loops (while). The code includes instructions on how to declare variables, determine letter grades, and create conditions using boolean values. It also covers the rules of using if statements and java's while loop.
Typology: Lecture notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


//declare variabes
//determine letter grade
//declare varaibles 2 acccept pacakge type paca
3 accept
4 calculate bill if package = A
review chapter 3 4 5 6
ch4 loops... [LEARN RULES OF IF STATEMENT + and java rules..] !BOOLEAN IS EITHER TRUE OR FALSE! any type of loop with paranetheseis can put it in
while ( ) condition loop true or false how to create condition is = boolean
"boolean b = false"; if(b [can put boolean here[stick variable name]] ) { =
IF FALSE NOT TRUE WONT EXCECUTE condition if BOOLEAN condition is true it will execute
int x = keyboard.textInt(); if(x>10) }
EXAMPLE intx= while(x<=20 ) { system.out.printin("dante") x++; }
public class Temperature { private double ftemp;
public Temperature (double f) { fTemp = fgiven;
public void setFarenheit() { return ftemp;
public double getFarenheit() }
public double getKelvin() {
Temperature temp1 = new Temperature(userFahrenheitTemperature); // ( VARIABLE )