Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using c# that recommends an activity based on the current temperature and weather. First, the user should input a temperature in degrees

Write a program using c# that recommends an activity based on the current temperature and weather. First, the user should input a temperature in degrees farenheit. Second, they should input the weather using "P" for rain/snow, "S" for sunny, and "O" for cloudy. If they do not enter a correct weather then assume it is "O". Create a method which takes the temperature value and returns the value "H" (for hot) if the temperature is greater than 72, "M" (for mild) if the temperature is between 60 and 72 degrees inclusive, and "C" (for cold) if the temperature is less than 60 degrees. Create another method which takes the weather (P, S, or O) and the temperature character (H, M, or C) and outputs a recommended activity based on the following:

Temperature Weather Activity
H P Soccer
H S Swimming
H O Baseball
M P Indoor Basketball
M S Tennis
M O Outdoor Basketball
C P Sledding
C S Running
C O Hockey

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

design a simple performance appraisal system

Answered: 1 week ago