1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
DIA [1.3K]
3 years ago
13

Write switch-case statement that displays the following information if the temperature is the input Activities at Lake LazyDays

program: As activity directory at Lake LazyDays Resort, it is your job to suggest appropriate activities to guests based on the weather: temp p-80: swimming 60 temp 80: tennis 40 temp <60: golf temp< 40: skiing
Computers and Technology
1 answer:
Marta_Voda [28]3 years ago
3 0

Answer:

//here is code in c++.

#include <bits/stdc++.h>

using namespace std;

int main()

{

// variable

int temp;

cout<<"Please enter the temperature:";

//read temperature from user

cin>>temp;

int n;

// reduce the case for switch

n=temp/10;

// print output according to the switch case

switch (n) {

case 7:

case 6:

cout<<"tennis"<<endl;

break;

case 5:

case 4:

cout<<"golf"<<endl;

break;

default:

if(temp>=80)

cout<<"swimming"<<endl;

else

cout<<"skiing"<<endl;

break;

}

return 0;

}

Explanation:

Read the value of temperature from user and assign it to variable "temp".

Calculate n=temp/10, to limit the number of cases in the switch statement.

if temperature is greater or equal 60 & less than 80, it will print "tennis".

If temperature is greater or equal 40 & less than 60, it will print "golf".

in default case, if temperature is greater than 80, it will print "swimming".

if less than 40, print "skiing".  

Output:

Please enter  the temperature::67                                                                                        

tennis

You might be interested in
What are some direct access devices
bija089 [108]
Like a DVD and stuff like that.
3 0
3 years ago
In which of the following scenarios would you use the Redo function?
MakcuM [25]
D. <span>You have just used the Undo function to delete a paragraph, and you want that paragraph back.</span>
6 0
3 years ago
Which of the following is NOT a font style?<br> Italic<br> Bold<br> Regular<br> Iconic
madam [21]

Answer:

iconic

Explanation:

iconic iconic iconic

8 0
3 years ago
Read 2 more answers
2+2<br>in excel cell body formula
never [62]

Answer:

Use the "Power" function to specify an exponent using the format "Power(number,power)." When used by itself, you need to add an "=" sign at the beginning. As an example, "=Power(10,2)" raises 10 to the second power.

4 0
3 years ago
A) What is the initial configuration BPDU for B4? B) What is the configuration BPDU of B3 after receiving the initial configurat
Dmitry [639]

Answer: b is good

Explanation:

5 0
3 years ago
Other questions:
  • If your computer freezes on a regular basis and you checked your hard drive and you have insufficient space you've not installed
    11·2 answers
  • True false you cannot fill in a callout​
    14·1 answer
  • 22 If you are involved in a violation and you do not have insurance to comply with the __________________, your driver license a
    9·2 answers
  • You need to access the registry on your windows 10 computer how do you do this
    9·1 answer
  • Write the document type declaration markup statement for an HTML5 file. Be sure to include the appropriate opening and closing b
    12·1 answer
  • You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
    5·1 answer
  • Brake fluid is made up of a chemical that:
    13·2 answers
  • What are Manuscript signs​
    8·1 answer
  • A large amount of data is stored in secondary storage is it true<br>​
    8·2 answers
  • The amount of data that can be stored on a disk depends in part on_____.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!