Question: A structure chart showing the functional decomposition of your program ( may be hand drawn neatly and scanned into the report ) An IPO chart

A structure chart showing the functional decomposition of your program (may be hand drawn
neatly and scanned into the report)
An IPO chart for each user-defined function
In your code add comments at the beginning of the script that summarizes the inputs, process,
and outputs for the program.
For user-defined functions add comments to the function prototypes that describe the
preconditions and post condition for the function.
Answer the following questions:
1. What did you find most challenging with this program?
2. What problems did you encounter and how did you solve them?
3. What did you learn from writing this program?
Writing Gas Prices code python
This project consists of a series of programs to analyze gas prices between April 1993 and August 2013.
You will be provided with a text file named GasPrices.txt. The file contains the weekly average prices for
a gallon of gas in the United States, beginning on April 5th,1993, and ending on August 26th,2013.
Figure 8-8 shows an example of the first few lines of the files contents:
Figure 8-8 The GasPrices.txt file
Each line in the file contains the average price for a gallon of gas on a specific date. Each line is
formatted in the following way:
MM-DD-YYYY:Price
MM is the two-digit month, DD is the two-digit day, and YYYY is the four-digit year. Price is the average
price per gallon of gas on the specified date.
To get full credit for this project, you must complete programs 1,2 and 3. You will get extra credit for
completing programs 4, and 5(you will get credit for each extra program you complete).
1. Average Price Per Year: Calculate the average price of gas per year, for each year in the file.
(The files data starts in April of 1993, and it ends in August 2013. Use the data that is present
for the years 1993 and 2013). Produce a report showing each year and the average gas price for
that year.
2. Highest and Lowest Prices Per Year: For each year in the file, determine the date and amount
for the lowest price, and the highest price. Produce a report showing for each year, the lowest
price and date on which it occurred and the highest price and the date on which it occurred
(show one year per line).
3. Average Price Per Month: Calculate the average price for each month in the file. Produce a
report that shows each month and year and the average price for that month and year.
4. List of Prices, Lowest to Highest: Generate a text file that lists the dates and prices, sorted from
the lowest price to the highest.
5. List of Prices, Highest to lowest: Generate a text file that lists the dates and prices, sorted from
04-05-1993:1.068
04-12-1993:1.079
04-19-1993:1.079
04-26-1993:1.086
05-03-1993:1.086
05-10-1993:1.097
05-17-1993:1.106
05-24-1993:1.106
05-31-1993:1.107
06-07-1993:1.104
06-14-1993:1.101
06-21-1993:1.095
06-28-1993:1.089
07-05-1993:1.086
07-12-1993:1.081
07-19-1993:1.075
07-26-1993:1.069
08-02-1993:1.062
08-09-1993:1.06
08-16-1993:1.059
08-23-1993:1.065
08-30-1993:1.062
09-06-1993:1.055
09-13-1993:1.051
09-20-1993:1.045
09-27-1993:1.047
10-04-1993:1.092
10-11-1993:1.09
10-18-1993:1.093
10-25-1993:1.092
11-01-1993:1.084
11-08-1993:1.075
11-15-1993:1.064
11-22-1993:1.058
11-29-1993:1.051
12-06-1993:1.036
12-13-1993:1.018
12-20-1993:1.003
12-27-1993:0.999
01-28-2013:3.427
02-04-2013:3.604
02-11-2013:3.677
02-18-2013:3.812
02-25-2013:3.851
03-04-2013:3.826
03-11-2013:3.779
03-18-2013:3.764
03-25-2013:3.746
04-01-2013:3.714
04-08-2013:3.676
04-15-2013:3.611
04-22-2013:3.603
04-29-2013:3.587
05-06-2013:3.602
05-13-2013:3.665
05-20-2013:3.729
05-27-2013:3.704
06-03-2013:3.705
06-10-2013:3.715
06-17-2013:3.689
06-24-2013:3.645
07-01-2013:3.567
07-08-2013:3.563
07-15-2013:3.706
07-22-2013:3.751
07-29-2013:3.716
08-05-2013:3.701
08-12-2013:3.633
08-19-2013:3.622
08-26-2013:3.623

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!