Question: 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
Get step-by-step solutions from verified subject matter experts
