Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Java Programming

Authors: Joyce Farrell

9th edition

1337397075, 978-1337397070

More Books

Students also viewed these Programming questions