Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here are the numbers: 0.992 0.995 1.001 0.999 1.005 1.007 1.016 1.009 1.004 1.007 1.005 1.007 1.012 1.011 1.028 1.033 1.037 1.04 1.045 1.046 1.05

Here are the numbers:

0.992 0.995 1.001 0.999 1.005 1.007 1.016 1.009 1.004 1.007 1.005 1.007 1.012 1.011 1.028 1.033 1.037 1.04 1.045 1.046 1.05 1.056 1.065 1.073 1.079 1.095 1.097 1.103 1.109 1.114 1.13 1.157 1.161 1.165 1.161 1.156 1.15 1.14 1.129 1.12 1.114 1.106 1.107 1.121 1.123 1.122 1.113 1.117 1.127 1.131 1.134 1.125

These are the numbers in the txt file. These are average costs per week. 52 averages for the entire year of 1994.

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

What types of questions are answered by the financial statements?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago