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]
4 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]4 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
Which of these has the LEAST impact on causing the phenomenon known as acid raid?
vfiekz [6]

Answer:A)pollution in lakes and rivers

Explanation:A has the least impact on the weather since it doesnt pollute the air, it only pollutes the environment around the lakes and rivers that are polluted. i dont need brainly you should give it to somebody else :)

4 0
3 years ago
Read 2 more answers
Which of these is a way of making applications less vulnerable to hacking?
Alecsey [184]
(First one )
---------------------
7 0
3 years ago
Read 2 more answers
A crane is attempting to lift a beam that exceeds its load rating. What type of accident is possible?
MatroZZZ [7]

Answer:sum of weights of attachments, lift, rigging, and on some machines cable ... condition of crane loading wherein the load moment action to over turn the crane is EQUAL to the maximum moment of the crane available to .

Explanation:

sum of weights of attachments, lift, rigging, and on some machines cable ... condition of crane loading wherein the load moment action to over turn the crane is EQUAL to the maximum moment of the crane available to .

8 0
4 years ago
Leah wants to create a PowerPoint presentation for a history report about the progressive era in the 1900s. To
Nutka1998 [239]

Answer:

File

Explanation:

8 0
3 years ago
Read 2 more answers
When should you close the socket python tcp server client.
Aleksandr-060686 [28]
F socket refers to an open TCP connection, the connection is closed. If a stream socket is closed when there is input data queued, the TCP connection is reset rather than being cleanly closed. The descriptor of the socket to be closed

To close the socket you need to call shutdown() first and then close(), and shutdown takes an argument
4 0
3 years ago
Other questions:
  • An example of software most commonly associated with productivity software is ____.
    12·1 answer
  • Which of the following is the definition of Internet Protocol Security ( IPSec)? A remote access client/server protocol. It is a
    13·2 answers
  • The government department responsible for laws concerning work is the
    12·1 answer
  • Can you give me a long list of anime
    6·2 answers
  • Define<br>output<br>devices<br>.<br>Give<br>any<br>three<br>examples<br>.<br>3.​
    8·2 answers
  • Which of the following is the best example of an installation issue
    11·2 answers
  • Write a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher. The script
    11·1 answer
  • What are the cloud storage components
    6·1 answer
  • Please answer questions in complete sentences!
    14·1 answer
  • Do you need to have java on your computer.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!