Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Answer 1 a if angle 90 cout The angle ...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