Question: CSC 118: Programming Fundamentals Lab 5: Programming assignment Programming assignment 1 (If-then and if-then-else): Use the following shell program for this assignment // Progr Temperature

 CSC 118: Programming Fundamentals Lab 5: Programming assignment Programming assignment 1

CSC 118: Programming Fundamentals Lab 5: Programming assignment Programming assignment 1 (If-then and if-then-else): Use the following shell program for this assignment // Progr Temperature reads in a temperature and prints an // appropriate message. #include using namespace std; int main ( int temperature; cout > temperature * TO BE FILLED IN return 8 Exercise I: Add five if-then statements to program Temperature (temperature.cpp) so that one of the following messages is printed based on the value of temperature 90 90,> 80 80,> 70 Visit a neighbor Turn on air conditioning Do nothing Turn on heat Visit a neighbor Run your program as many times as it takes to display each message exactly once. Which data values did you use? Exercise 2: Rewrite the program in Exercise I using nested logic (ie. if-then-else where the else branch is an if statement). Rerun the program with the same data. Did you get the same answers? Explain. Turn in: Your answers and codes for Exercise 1 and Exercise2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!