Question: 1. Write suitable if statements for the following conditions: a. If an angle is equal to 90 degrees, print the message The angle is

1. Write suitable if statements for the following conditions: a. If an angle is equal to 90 degrees, print the message The a

1. Write suitable if statements for the following conditions: a. If an angle is equal to 90 degrees, print the message "The angle is a right angle."; else, print the message "The angle is not a right angle." b. If the temperature is above 100 degrees, display the message "above the boiling point of water"; else, display the message "below the boiling point of water." c. If the number is positive, add the number to the variable positivesum; else, add the number to the variable negativesum. d. If the slope is less than 0.5, set the variable flag to 0; else, set flag to 1. 2. Rewrite the following if-else chain by using a switch statement: if (letterGrade == 'A') cout < < "The numerical grade is between 90 and 100"; else if (letterGrade== 'B') cout < < "The numerical grade is between 80 and 89.9"; else if (letterGrade 'C') cout < < "The numerical grade is between 70 and 79.9"; else if (letterGrade == 'D') cout < < "How are you going to explain this one?"; else { } cout < < "Of course I had nothing to do with my grade."; cout < < "It must have been the professor's fault.";

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets solve each part of the question 1 Writing suitable if statements a Angle check cpp if angle 90 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!