Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 The following program asks the user for the current temperature (in Fahrenheit). Provide a total of 7 valid test cases (one for each

Question 1

The following program asks the user for the current temperature (in Fahrenheit).

Provide a total of 7 valid test cases (one for each message). Do not provide invalid test

cases.

Add a

series of if statements (if with multiple alternatives i.e. if/else if/else) so that

one

of the

following messages is printed based on the temperature value:

Temperature (F) Message

>90 Go swimming.

<=90, >80 Turn on air conditioning.

<=80, >70 Do nothing.

<=70, >55 Turn on heat.

<=55, >30 Wear a heavy coat.

<=30, >0 Wear gloves.

<=0 Stay inside, make a fire.

// Include ALL the compiler directives you need in the program

/* to be filled in*/

using namespace std;

int main()

{

int temperature;

cout << Please enter the current temperature (F): ;

cin >> temperature;

// add cascading if-else statements to complete the program

/* to be filled in by student */

system(pause);

return 0;

}

Test #

Valid / Invalid Data

Description of test

Input Value

Actual Output

Test Pass / Fail

1

Valid

Pass

2

Valid

Pass

3

Valid

Pass

4

Valid

Pass

5

Valid

Pass

6

Valid

Pass

7

Valid

Pass

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

When does the auditor test internal controls?

Answered: 1 week ago