Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Which of these is the output of the following program? int grade = 6 ; if ( grade > 5 ) { System.out.println (

Which of these is the output of the following program?
int grade =6;
if(grade >5){
System.out.println("Added water.");
}
else if(grade >3){
System.out.println("Added soda.");
}
if(grade >3){
System.out.println("Added ice.");
}
if(grade >2){
System.out.println("Added straw.");
}
if(grade <=2){
System.out.println("Added lemon.");
}
A.)Added water.
Added soda.
Added ice.
Added straw.
B.)Added water.
Added ice.
Added straw.
C.)Added soda.
Added ice.
Added straw.
D.)Added water.
Added soda.
Added ice.
Added straw.
Added lemon.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions