Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

Graph y = - 1 / 4 x + 3 using the slope and the y-intercept.

Answered: 1 week ago

Question

=+ (c) Find a bounded negligible set that is not trifling.

Answered: 1 week ago