Java - Review 1
Java - Review 1
3. int x = 100;
int y = 50;
if (x == y){
System.out.println("Hello");
}
4. int x = 100;
int y = 100;
if (x == y){
System.out.println("Hello");
}
5. int x = 100;
int y = 101;
if (x > y)
System.out.println("Hello");
else
System.out.println("Goodbye");
6. int x = 100;
int y = 101;
if (x < y){
System.out.println("Hello");
}
else {
System.out.println("Goodbye");
}
17. if (LIMIT%MAX == 3)
System.out.println ("apple");
else if (num2 == MAX)
System.out.println ("orange");
else
System.out.println ("pear");
Computer Science Test Review Name _______________
Review is due for a grade before your test
18. if (num3 >= MAX)
{
if (MAX/num2 == 1){
System.out.println ("apple");
}
System.out.println ("orange");
if (LIMIT-num3 > num1+2){
System.out.println ("pear");
}
else {
System.out.println ("banana");
System.out.println ("kiwi");
}
}
else if (num2*2 == MAX*2){
System.out.println ("grapefruit");
}
else {
System.out.println ("lime");
}
System.out.println ("coconut");
Determine the output for each program segment that follows. If it has no output, print No
Output.