Question: NEED HELP WITH 3 a. and b. 3. C selection statements a. In the following code, C would check the condition of each if statement
NEED HELP WITH 3 a. and b.
3. C selection statements a. In the following code, C would check the condition of each if statement even if only one if statement condition is true. In addition, three if statement conditions (ii, iii, v) could be true, such as when inlbs has the value 80 so that digout is set to a value thrice. The if statement condition at v is incorrect since digout should have the value 1011 if inlbs is lower than 60. Rewrite the code as one nested if/else construct similar to the code on slide 16 of chapter 4 so that can evaluate the if statement more efficiently and correctly. Presume that equality should only be checked with inlbs >= ? rather than inlbs = 90) digout = 1111; ii. if (inlbs >- 80 && inlbs = 70 && inlbs = 60 && inlbs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
