Question: Python This assignment is to have you use Sentinel-Controlled Repetition and the Statistics library. It is your job to write a program to calculate the

Python

Python This assignment is to have you use Sentinel-Controlled Repetition and the

This assignment is to have you use Sentinel-Controlled Repetition and the Statistics library. It is your job to write a program to calculate the average fuel usage for a vehicle. You will ask the user for three pieces of information each loop through the program - the number of kilometers traveled and the amount of fuel put in the tank during that fillup (in liters). From this, you will be able to calculate the number of liters per 100kms traveled (this is the standard for calculating fuel efficiency in cars). So, if the user enters in 520kms and 55L, then the answer will be 10.6L/100kms. (The math is (L / km)*100.) Round your output to 1 decimal place. Allow the user to enter in as many entries as they would like, calculating the fuel efficiency for each fill-up. When the user indicates that they are done, calculate the following: Overall fuel efficiency (for the total distance traveled and total fuel used). The mean number of kms traveled between fillups. The median number of kms travelled between fillups. The max/min number of kms travelled between fillups. Note: you can create a list in Python by declaring the following: kms list = [] This will be an empty list. You can add values to the list using the following: kms_list.append (25) where 25 is replaced by the number input from the user. Remember that you can calculate the sum of a list by using the built-in sum() function. Advice on approach to solving this problem: Write the code to get the kms and liters of fuel from the user first. Once that is working, Write the code to put that in a loop to get multiple entries from the user. Once that is working, Write the code to add the entries to a list. Once that is working, Write the code to calculate the information needed

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 Databases Questions!