Question
Write an application that enables you to randomly record water depths for 5 different locations at 0700 (7 a.m.), 1200 (12 p.m.), 1700 (5 p.m.),
Write an application that enables you to randomly record water depths for 5 different locations at 0700 (7 a.m.), 1200 (12 p.m.), 1700 (5 p.m.), and 2100 (9 p.m.). The locations are Surf City, Solomons, Hilton Head, Miami, and Savannah.
For ease of input, you may want to code the locations (i.e. Surf City = 1, Solomons = 2, etc.) and code the times the same way. If the same location and time are entered more than once, store the last value entered into the array.
After the data is entered, display a table showing the individual data in rows and columns as well as the average depth at each location and the average depth by time period.
I believe the main logic should look something like this:
public static void Main(string[] args)
{
double[,] waterDepth = new Double[6, 5];
string[] location = { "Surf City", "Solomons", "Hilton Head", "Miami", "Savannah" };
string[] time = { "7:00 A.M.", "12:00 P.M.", "5:00 P.M.", "9:00 P.M." };
InitializeArray(waterDepth);
GetWaterDepths(waterDepth, location, time);
FindAvgDepthByLocation(waterDepth);
FindAvgDepthByTime(waterDepth);
DisplayTable(waterDepth, location, time);
Console.ReadKey();
}
Step by Step Solution
3.40 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
using System namespace water class Program static void ...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