Question: A program is being written to calculate and print average km per litre petrol (mileage) for a car after five petrol fill-ups. Assume that we

A program is being written to calculate and print average km per litre petrol (mileage) for

a car after five petrol fill-ups. Assume that we start with a full-tank and each time at the

filling, we fill the tank fully. Inputs are: Odometer reading at the starting, Odometer

reading, one by one, at the time of each filling, and amount of petrol filled, one by one,

at the time of each filling. Outputs: At each filling, print the mileage for that filling: At the

end print the overall average mileage. Use Loop.

For this program, write PAC, Algorithm and flow chart. Show the iteration table.

Note :complete by using python only

Example: We start with full tank and Odometer reading: odometer_first-3000. At filling place 1: Odometer-3200: petrol_filled-5 lit; so mileage (3200-300)/5 (print) At filling place 2: Odometer=3450; petrol_filled-6 lit; so mileage=(3450-3200)/6 (print)

Finally overall average mileage = (Odometer_last-Odometer_start)/(total petrol filled)

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!