Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help with this C# problem: Problem 1 - Three hot weeks For four weeks in the summer, Springfield has experienced some hot temperatures. In
need help with this C# problem:
Problem 1 - Three hot weeks For four weeks in the summer, Springfield has experienced some hot temperatures. In this problem, you'll declare and initialize the temperatures, find the average temperature, and identify how many times the temperature exceeded 90 degrees. No methods are required for Problem 1. Here are the steps to follow: 1. Declare and initialize a two-dimensional array as follows. Rows are for weeks, and each column is a day of the week. Name the array temps. Note: the array must be a 3x7 array. There may be no extra elements. Week Sun (1) Mon (2) Tue (3) Wed (4) Thu (5) Fri (6) Sat (7) 1 85 87 91 95 72 79 82 103 105 110 94 88 87 88 93 95 92 99 80 91 85 2. Prompt the user for a week number (1-3). Validate that the input is numeric and that the number represents a valid week. If it is not valid, display an error message and re-prompt. Continue until the user enters a valid week number. 3. Prompt the user for a day number (1-7). Validate that the input is numeric and that the number represents a valid day. If it is not valid, display an error message and re-prompt. Continue until the user enters a valid day number. 4. Display the temperature for the selected day. 5. Using nested for loops: a. Calculate the average temperature for each week as a double b. Print the average temperature, one week per line, in this format (note that the temperature has one decimal point): The average temperature for week 1 was xx.x 6. Use a foreach loop to count the total number of days over the three-week period that the temperature was over 90 degrees and display it with an appropriate message. *** PROBLEM 1 *** Enter week number (1 3): x Invalid week number. Please try again: 2 Enter day number (1 - 7): 3 The temperature on week 2, day 3 was 110 The average temperature for week 1 was 84.4 The average temperature for week 2 was 96.4 The average temperature for week 3 was 90.7 There were 11 days over 90 in this three-week periodStep 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