Question: Hello! Could anyone get me started on this program? I have a txt file with 52 numbers all varying around $1. These are average costs
Hello! Could anyone get me started on this program? I have a txt file with 52 numbers all varying around $1. These are average costs per week. 52 averages for the entire year of 1994. I just need an outline or something to get me started for ArrayList because I am lost. Thanks!
In the student sample programs for this book, you will find a text file named 1994_Weekly_Gas_Averages.txt. The file contains the average gas price for each week in the year 1994. (There are 52 lines in the file. Line 1 contains the average price for week 1, line 2 contains the average price for week 2, and so forth.) Write a program that reads the gas prices from the file into an array or an ArrayList. The program should do the following:
Display the lowest average price of the year, along with the week number for that price, and the name of the month in which it occurred.
Display the highest average price of the year, along with the week number for that price, and the name of the month in which it occurred.
Display the average gas price for each month. (To get the average price for a given month, calculate the average of the average weekly prices for that month.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
