Question
i need help with this c++ question: In the student sample programs for this book, you will find a text file named 1994_Weekly_Gas_Averages.txt. The file
i need help with this c++ question:
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.)
here is the code for the 1994_ weekly_gas_averages.txt: 01 0.992 01 0.995 01 1.001 01 0.999 01 1.005 02 1.007 02 1.016 02 1.009 02 1.004 03 1.007 03 1.005 03 1.007 03 1.012 04 1.011 04 1.028 04 1.033 04 1.037 05 1.040 05 1.045 05 1.046 05 1.050 05 1.056 06 1.065 06 1.073 06 1.079 06 1.095 07 1.097 07 1.103 07 1.109 07 1.114 08 1.130 08 1.157 08 1.161 08 1.165 08 1.161 09 1.156 09 1.150 09 1.140 09 1.129 10 1.120 10 1.114 10 1.106 10 1.107 10 1.121 11 1.123 11 1.122 11 1.113 11 1.117 12 1.127 12 1.131 12 1.134 12 1.125
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