Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started