Question
This java program is based off the scenario below. I am in need of help creating/completeing this code. The code I currently have keeps giving
This java program is based off the scenario below. I am in need of help creating/completeing this code. The code I currently have keeps giving me errors for some reason. Any chance I could get some help with writing this code?
According to the National Weather Services website, the Heat Index (HI) is determined as follows:
The Heat Index Equation The computation of the heat index is a refinement of a result obtained by multiple regression analysis carried out by Lans P. Rothfusz and described in a 1990 National Weather Service (NWS) Technical Attachment (SR 90-23). The regression equation of Rothfusz is HI = -42.379 + 2.04901523*T + 10.14333127*RH - .22475541*T*RH - .00683783*T*T - .05481717*RH*RH + .00122874*T*T*RH + .00085282*T*RH*RH - .00000199*T*T*RH*RH where T is temperature in degrees F and RH is relative humidity in percent. HI is the heat index expressed as an apparent temperature in degrees F.
Taking the heat index into account, commonly the following results (according to, e.g., Wikipedia):
Fahrenheit | Notes |
8090 F | Caution: fatigue is possible with prolonged exposure and activity. Continuing activity could result in heat cramps. |
90105 F | Extreme caution: heat cramps and heat exhaustion are possible. Continuing activity could result in heat stroke. |
105130 F | Danger: heat cramps and heat exhaustion are likely; heat stroke is probable with continued activity. |
over 130 F | Extreme danger: heat stroke is imminent. |
Based on this information, you are asked to respond to some questions from the Pure Michigan Marketing team that wants to determine alternatives in the timing for the annual bridge walk. One suggestion is to start the walk at 05:00, whereas another suggestion is to let the walk continue until 19:00. (Note that 19:00 is the end time for the walk not the start of the last walker.)
Since nobody likes heat exhaustion or heat stroke, heat indices above 90 are considered prohibitive, as is rain.
To determine feasible options, you are provided with the LaborDay.csv files which contain the information from last years' Labor Day for time of day, temperature, relative humidity, and precipitation. They are aware that they can re-purpose this approach for other venues as well, so you are to write a program that performs the tasks in an automated fashion, allowing for flexibility (given the current file format).
Read the values into a multidimensional array, whereby each individual row of the file should be an array itself. (Hint: note the first row contains the labels.) You should then design and implement:
Reading of the file in its own method returning the 2D array,
Calculation of the HI for the values provided in its own method,
Determination of the average and max. heat indices for two-hour time periods which is considered the time it takes one walk,
Simple decision whether a starting/end time would be prohibitive (HI or rain) given the 2-hour time windows.
You are to output the calculation in a simple CSV format to STDOUT that contains columns with the start time, HI averages and maxima (each float format, 2 decimals) and "Yes" / "No" strings if the start at a particular time would be prohibitive. For the output, select to start at full hours only and within the given time window.
This is the information below is what's suppose to be in the txt file that you input to use for the numbers.
LaborDay.txt
Time,T,RH,Prec 0:15,69.3,66,0 0:30,69.4,67,0 0:45,69.4,66,0 1:00,69.6,66,0 1:15,69.4,67,0 1:30,68.4,69,0 1:45,68.9,68,0 2:00,67.8,68,0 2:15,68.7,67,0 2:30,68.2,68,0 2:45,68.5,68,0 3:00,68.4,70,0 3:15,68.5,70,0 3:30,68.4,69,0 3:45,68.7,66,0 4:00,66.7,71,0 4:15,66.2,69,0 4:30,67.1,65,0 4:45,66,71,0.3 5:00,65.5,72,0.3 5:15,65.5,75,0.3 5:30,65.5,75,0.2 5:45,65.1,73,0.1 6:00,65.1,72,0 6:15,64.8,72,0 6:30,64.8,74,0 6:45,64.8,74,0 7:00,64.9,77,0 7:15,65.1,79,0 7:30,65.1,81,0 7:45,66.2,86,0 8:00,66.4,92,0 8:15,66.2,79,0 8:30,66.2,78,0 8:45,66,79,0 9:00,66,80,0 9:15,66.4,79,0 9:30,67.1,79,0 9:45,67.3,79,0 10:00,67.3,79,0 10:15,67.6,81,0 10:30,68.9,82,0 10:45,73.2,80,0 11:00,78.1,77,0 11:15,81,77,0 11:30,84.4,71,0 11:45,81.3,73,0 12:00,86.5,69,0 12:15,86.9,67,0 12:30,87.3,69,0 12:45,87.4,72,0 13:00,88,70,0 13:15,95.2,67,0 13:30,90.9,66,0 13:45,85.5,71,0 14:00,87.8,70,0 14:15,83.1,74,0 14:30,87.8,70,0 14:45,81.5,73,0 15:00,85.5,69,0 15:15,88.2,66,0 15:30,83.8,70,0 15:45,87.6,67,0 16:00,90.7,66,0 16:15,90.7,69,0 16:30,90.9,66,0 16:45,86.7,69,0 17:00,86.2,70,0 17:15,86.9,67,0 17:30,85.8,66,0 17:45,84.7,68,0 18:00,82.2,67,0 18:15,81.1,63,0 18:30,79.2,60,0 18:45,75,61,0 19:00,72.9,63,0 19:15,71.4,64,0 19:30,70,66,0 19:45,68.7,67,0 20:00,67.6,66,0 20:15,66.7,67,0 20:30,66,67,0 20:45,65.3,70,0 21:00,64.6,71,0 21:15,64,71,0 21:30,63.3,70,0 21:45,62.8,73,0 22:00,62.4,75,0 22:15,61.7,76,0 22:30,61.3,76,0 22:45,61,79,0 23:00,60.4,84,0 23:15,60.1,85,0
An example of the output could look like this: 23:00, 69.66, 69.66, Yes
Step 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