Question
Write a C# console program that will compute the average of 4 separate weeks of average weekly temperatures for any given month. Create a console
Write a C# console program that will compute the average of 4 separate weeks of average weekly temperatures for any given month. Create a console program where you will implement variables that are needed for this program and will implement the code within Main and any static methods that are called. You will need variables for temperature, minimum temperature, maximum temperature, average temperature, total of temperatures and a count variable. Use a loop to call a static void calculate method four times, passing temperature, minimum temperature, maximum temperature, average temperature and total temperature by reference and pass count by value. In the calculate method ask the user for a single temperature entry, add it to the total, determine the minimum and maximum temperature for the current call to the method and compute the current average. When the loop in Main has taken all four entries and done the calculations call a static void display method to display the output for the min, max and average temperature for the four entries. You will pass the min temp, max temp and average temp. You should format your output to look something like the following: Please enter the average temperature for week 1 of the month: 11 Please enter the average temperature for week 2 of the month: 22 Please enter the average temperature for week 3 of the month: 33 Please enter the average temperature for week 4 of the month: 44 The lowest temperature for the month was : 11 degrees. The highest temperature for the month was : 44 degrees. The average temperature for the month was: 27.5 degrees. Press any key to continue . . .
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