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

1 Expert Approved Answer
Step: 1 Unlock

This question appears to be seeking a detailed program structure and explanation on how to implement an application to record and display water depths ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!