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
How do big organizations take back their data to be reviewed after a disaster?
Jet001 [13]
Here a 5 step recovery plan, I have been in IT for 8 years

1. Create a disaster recovery team.

The team will be responsible for developing, implementing, and maintaining the DRP. A DRP should identify the team members, define each member’s responsibilities, and provide their contact information. The DRP should also identify who should be contacted in the event of a disaster or emergency. All employees should be informed of and understand the DRP and their responsibility if a disaster occurs.

2. Identify and assess disaster risks.

Your disaster recovery team should identify and assess the risks to your organization. This step should include items related to natural disasters, man-made emergencies, and technology related incidents. This will assist the team in identifying the recovery strategies and resources required to recover from disasters within a predetermined and acceptable timeframe.

3. Determine critical applications, documents, and resources.

The organization must evaluate its business processes to determine which are critical to the operations of the organization. The plan should focus on short-term survivability, such as generating cash flows and revenues, rather than on a long term solution of restoring the organization’s full functioning capacity. However, the organization must recognize that there are some processes that should not be delayed if possible. One example of a critical process is the processing of payroll.

4. Specify backup and off-site storage procedures.

These procedures should identify what to back up, by whom, how to perform the backup, location of backup and how frequently backups should occur. All critical applications, equipment, and documents should be backed up. Documents that you should consider backing up are the latest financial statements, tax returns, a current list of employees and their contact information, inventory records, customer and vendor listings. Critical supplies required for daily operations, such as checks and purchase orders, as well as a copy of the DRP, should be stored at an off-site location.

5. Test and maintain the DRP.

Disaster recovery planning is a continual process as risks of disasters and emergencies are always changing. It is recommended that the organization routinely test the DRP to evaluate the procedures documented in the plan for effectiveness and appropriateness. The recovery team should regularly update the DRP to accommodate for changes in business processes, technology, and evolving disaster risks.



summary :an organization must develop a recovery team to create a disaster recovery plan that includes identifying and assessing disaster risks, determining critical applications, and specifying backup procedures. Other procedures may be included in the plan based on the organization. The recovery team and organization must then implement the DRP and follow through on the plan procedures. The DRP should be continually tested and maintained to consistently prepare the organization for evolving disasters and emergencies.
4 0
2 years ago
A ____ is a structure that allows repeated execution of a block of statements.
Leokris [45]

Answer:

loop

Explanation:

Loop is the one which is used to execute the specific statement again and again until the condition is true.

In the programming, there are 3 basic loop used.

1. for loop

<u>Syntax:</u>

for(initialization, condition, increment/decrement)

{

  statement;

}

the above statement execute until the condition in the for loop true when it goes to false, the loop will terminate.

2. while loop

<u>Syntax:</u>

initialization;

while(condition)

{

  statement;

increment/decrement;

}

it is work same as for loop and the increment/decrement can be write after or before the statement.

3. do while

syntax:

initialization;

do

{

   statement;

   increment/decrement;

}while(condition);

here, the statement execute first then, it check the condition is true or not.

so, if the condition is false it execute the statement one time. this is different with other loops.

3 0
3 years ago
Read 2 more answers
What is garbage in garbage out?​
Neko [114]

Answer: it means if you give a bad input it will result in a ad output.

Explanation:

It has n acronym GIGO which refers to how the quality of an output is determined by the quality of input.

Garbage is trash info... or input. And grabage out is the trash output.

8 0
2 years ago
Which of the following statements about the continue statement is true?
kotykmax [81]

Answer:

Option (d)

Explanation:

  • The Continue statement is used inside the looping statements.
  • When a Continue statement is encountered inside the loop, it stops executing the current iteration ( it skips the next steps in the current iteration) and goes to the next iteration.
  • It then continues to execute the loop for the next iteration.
  • The continue statement can be used in all the looping structures ( for loop, while loop, do while loop ).
  • The syntax for continue statement is " continue; "
  • Options (a),(b),(c) are wrong options.
  • Option (d) is correct option.
8 0
3 years ago
What type of software controls the hardware of a computer? Desktop publishing software Spreadsheet applications Groupware applic
Hatshy [7]
It's most likely the Operating System Applications
4 0
3 years ago
Other questions:
  • What happens if you move unencrypted files into an encrypted folder?
    5·1 answer
  • Identify the primary responsibilities associated with each of the following web design roles: content writer/editor, artist/grap
    13·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • How do you do basic addition and subtraction in binary, octal and hex?
    12·1 answer
  • In which of the security mechanism does the file containing data of the users/user groups have inbuilt security?
    6·1 answer
  • All nuclear energy results in the rapid release of energy, such as in atomic bombs. true or false
    8·1 answer
  • Which of the following is true regarding the use of instance variable j in class B1?
    15·1 answer
  • Drag each tile to the correct box.
    8·1 answer
  • The owner of a candle shop has asked for your help. The shop sells three types of candles as shown below:
    14·1 answer
  • What is the purpose of the GETPIVOTDATA function?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!