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
6. Which of the following is malware? (1 point)
marusya05 [52]
Software to damage computers
5 0
3 years ago
Read 2 more answers
1
g100num [7]
Have a look at the man page for printf:

man 3 printf
4 0
3 years ago
Read 2 more answers
Lập trình web truy vấn csdl và hienr thị ra màn hình danh sách các bản ghi
almond37 [142]

Answer:

ExplanatOverfishing occurs "when more fish are caught than the population can replace through natural reproduction," according to the World Wildlife . Once this occurs, the species is no longer "sustainable." Eighty-seven percent of all the world's fish stocks that we know about are at the "breaking point," according to the Environmental Defense Fund (EDF).

ion:

3 0
2 years ago
Apple users tend to like the company and love its products. Apple has successfully nurtured this __________ component of its cus
kow [346]

Answer:

Affective

Explanation:

Affective Component − This is the second model of customers attitude. This consists of a person’s feelings, sentiments, and emotions for a particular brand or product. They treat them as the primary criteria for the purpose of evaluation. The state of mind also plays a major role, like the sadness, happiness, anger, or stress, which also affects the attitude of a consumer.

7 0
2 years ago
Which of the following is NOT a safety practice for working near power lines?
dimulka [17.4K]
The answer is use rider posts, when available, to avoid getting too close to the power line. 

I hope this helps!  
5 0
3 years ago
Other questions:
  • What is a Better Computer?<br> A. Alien<br> B. Microsoft<br> C. Windows<br> D. Apple
    11·2 answers
  • Which statements describe the use of styles in Word? Check all that apply.
    11·2 answers
  • When a person or organization uses the services of another professional, that person or organization is called the _______
    15·1 answer
  • in java how do i Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
    6·1 answer
  • Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matc
    14·1 answer
  • Barbara, an employee, has properly connected her personal wireless router to a network jack inside her office. The router is una
    7·1 answer
  • Why would an end-user not generally buy a server? Explain your answer by referring to the typical role that servers perform. ​
    12·1 answer
  • Why is computer science hardware needed to solve problems with computers?
    9·1 answer
  • In object-oriented analysis, an object is a member of a(n) _____, which is a collection of similar objects.
    11·1 answer
  • Binary subtraction<br> Subtract (111) from (1000)
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!