Answered step by step
Verified Expert Solution
Question
1 Approved Answer
odd Questions 15,17,19,21 236 I Chapter 4: Control Structures : Selection oxe that score is an int variable. Consider the following if statements: if (score>=
odd Questions 15,17,19,21
236 I Chapter 4: Control Structures : Selection oxe that score is an int variable. Consider the following if statements: if (score>= 90); System.out.println ("Discount 108"); " What is the output if the value of score is 952 Justify your answer. b. What is the output if the value of score is 85? Justify your answer Suppose that score is an int variable. Consider the following if statements: i. if (score 70) i. if (score 70) 15. System.out.println("Grade is c.") System. out.printin ("Grade is C.") Answer the following questions: What is the output in (G) and (ii) if the value of score is 70? What is the a. value of score after the if statement executes? b. What is the output in (i) and (i) if the value of score is 80? What is the value of score after the if statement executes? Rewrite the following expressions using the conditional operator. (Assume that all variables are declared properly.) a. if (x -y) 16. else z=y-x; b, if (hours >= 40.0) wages 40 7.50 1.5 7.5 (hours 40); wages hours * 7.50; str -"pass"; str "Fail"; else c. if (score-60) else Rewrite the following expressions using an if.. .else statement. (Assume that all variables are declared properly.) a. (x = 10) ? drive-150 : drive-30; (booksBought > 3) 2 discount 0.15: discount 0.0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started