Docsity

Java Programming: Conditional Statements and Loops, Lecture notes of Computer System Design and Architecture

Toggle sidebar
bg1
//declare variabes
//determine letter grade
13- C3
//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
OR
int x = keyboard.textInt();
if(x>10)
}
EXAMPLE
intx=1
while(x<=20 )
{
system.out.printin("dante")
x++;
}
/////
pf2

Partial preview of the text

Download Java Programming: Conditional Statements and Loops and more Lecture notes Computer System Design and Architecture in PDF only on Docsity!

//declare variabes

//determine letter grade

13- C

//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

OR

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 )