You have been contracted by the local meteorologist to design an application tha
ID: 3785207 • Letter: Y
Question
You have been contracted by the local meteorologist to design an application that can be used to determine and display the average and high wind speeds for a given day. The wind speed is measured at 8 a.m., 12 noon and 5 p.m. every day during the week. Place the following data in a text file and use it for testing. The first value retrieved from the file is the day number (where Monday = 1. Tuesday = 2; Wednesday = 3: Thursday = 4; Friday = 5). The second, third and fourth values are the wind speed at a given time. The second value is the wind speed at 8:00 a.m.. the third value is the wind speed at noon and the fourth value is the wind speed at 5 p.m. Your application should be able to provide the following methods: DeterminoAverageWindSpecd() Returns the average wind speed for the given day DetermineHighestWindSpeed () Returns the highest wind speed value for the given day DisplayAllResults(> Returns details about the given day as shown below Create a multi-class solution, one that handles the business logic and a separate that test the class. The second class can be a Windows or Console app. Create an array to store the day names (Monday. Tuesday....Friday) Create an array to store the time of day (8:00. Noon, 5:00) Retrieve the data from the text file and store wind speed in an array Include exception handling techniques Have extra time....for extra credit: Store one day's worth of data on a single line in your file Place multiple days' worth of data in the fileExplanation / Answer
static public double DetermineAverageWindSpeed(int first,int second,int third)
{
Console.writeln("average is:");
Console.writeln((first+second+third)/3);
return (first+second+third)/3;
}
static public int DetermineHighestWindSpeed(int first, int second, int third)
{
if(first >second)
{
if(first >third)
return first;
else
return third;
}
else
{
if(second > third)
return second;
else
return third;
}
}
static public void DisplayAllResults(int avg,int high,string day,.int first,int second,int third)
{
Console.writeln("Day 8.00 Noon 5.00 AVG HIGH");
Console.write( day + first + second + third + avg + high);
}
Text File:
2
35
47
26
3
26
35
29
1
23
35
30
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.