Answer to Question #145310 in Java | JSP | JSF for Hamza saeed

Question #145310
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.
1
Expert's answer
2020-11-20T14:24:11-0500

a. Output is "Discount = 10%"

b. Output is the same - "Discount = 10%"


println is not inside of the "if" operator scope (not included in curly brackets) so the "if" condition doesn't impact execution of println.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS