Question: In Python please Problem: Gas Prices In this project, you will read a data file named GasPrices.txt , which contains the weekly average prices for

In Python please
Problem: Gas Prices
In this project, you will read a data file named GasPrices.txt, which contains the weekly average prices for a gallon of gas in the US, beginning on April 5th,1993, and ending on August 26tt,2013, as shown below (first few lines of the file contents):
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
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.
You are to one or more programs/functions that read the contents of the file and find the following seperately please and label them:
- Average Price Per Year: Calculate the average price of gas per year, for each year in the file.
- Average Price Per Month: Calculate the average price of gas for each month in the file.
- Highest and Lowest Prices Per Year: For each year in the file, determine the date and amount for the lowest and highest gas prices.
- List of Prices, Lowest to Highest: Generate a Text file that lists the date and prices, sorted from the lowest to highest prices.
- List of Prices, Highest to Lowest: Generate a Text file that lists the date and prices, sorted from the highest to lowest prices.
Hints: Write one program with each function for separate activities.
In Python please Problem: Gas Prices In this

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!