Computers and Technology

Create a Python program that: Opens a file and reads the contents of the following file
trips. txt
The file contains several lines of data, with each data item separated by commas. The data is:
A trip date
The amount of fuel used on the trip
The number of miles traveled on the trip
For each of the lines of data in the file, separate the data items and put them in appropriate variables
The file contents are in the form of strings, so you must convert the numbers in the data into the proper type
Create a function that calculates the fuel mileage achieved on each trip
Pass the appropriate data to this function
Place this function in a separate module
Call the function as needed and have the function return the calculated fuel mileage
Create a function that displays the following items on a single line, and place the function in the same module as the previous function.
Pass the appropriate data to this function
Trip data
Amount of fuel used
Numbers of miles traveled
Fuel mileage calculated for the trip
Call the function as needed to display the data items
Create a new file to save the data read and the fuel mileage calculated for the trip
Write the data on separate lines for each trip in the data, with each item separated by commas
Remember that all of the data must be saved in the string form
The program should:
Use variables with meaningful names
Name the module containing the functions "SupportMod. py"
Import the module into your program
Display easily understood prompts when collecting user input
Prompt the user for the name of the file to read the data from, and the name of the file to store the revised data
Have appropriate comments indicating what each part of the program is doing
Have a comment area at the beginning of the program identifying the author of the program and the class it was created for
Can someone create a code that does this for me?
Sample data:
1-21-2019,12,243
1-23-2019,15.3,302.4
1-25-2019,10.9,209.3
1-31-2019,23.2,543.9
2-13-2019,15.3,409.3

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, lindalu
Hassan is writing his master’s thesis, which is a thirty-page document. he received some feedback from his professor in the form of comments, but does not see where the comments are. what is the fastest way for hassan to find the feedback?
Answers: 3
image
Computers and Technology, 23.06.2019 11:30, kieante01
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, jhitotw
What is the primary difference between the header section of a document and the body? a. the body is displayed on the webpage and the header is not. b. the header is displayed on the webpage and the body is not. c. the tag for the body is self-closing, but the tags for the headers must be closed. d. the tag for the header is self closing, but the tag for the body must be closed.
Answers: 3
image
Computers and Technology, 24.06.2019 06:30, meganwintergirl
Ineed to know the anwser to all these questions
Answers: 2
Do you know the correct answer?
Create a Python program that: Opens a file and reads the contents of the following file
trips...

Questions in other subjects:

Konu
Biology, 02.03.2021 21:00
Konu
Mathematics, 02.03.2021 21:00