Suppose that score is an int variable. Consider the following if statements: if (score >= 90);
System.out.println("Discount = 10%");
a. What is the output if the value of score is 95? Justify your answer.
b. What is the output if the value of score is 85? Justify your answer.
a. Output is Discount = 10%. Because 95>90 and this if return true and perform the line below.
b. Output return nothing. Because 85<90 and this if return false since we do not have else returns nothing.
Comments
Leave a comment