Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Neo4j

Authors: Gregory Jordan

1st Edition

1484200225, 9781484200223

More Books

Students also viewed these Databases questions

Question

To solve p + 3q = 5z + tan( y - 3x)

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago