Question: For this exercise create a new version of the rainfall examples in this chapter. This new version should use a loop to read the monthly
For this exercise create a new version of the rainfall examples in this chapter. This new version should use a loop to read the monthly rainfall from the rainfalltxt file, accumulate the total rainfall for the first and last months of the year months altogether and also display the name of the month and monthly rainfall for each of these months. You don't need to use a table although you can if you'd like to The results should be something like this:
JAN:
FEB:
MAR:
OCT:
NOV:
DEC:
Total Rainfall for these months: inches.
rainfalltxt:
HINT: Review the first four rainfall examples in the chapter. You may find it useful to copy some of the code in these files in your samples folder into rainfallreport.php Of course you will need to modify the code to meet these new requirements. Each time the loop repeats a new rainfall amount is read from the file. Consider carefully what you need to do inside the loop, remember that you must print the name of each month and the amount, and also accumulate the total, but only for the first and last months.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
