Write a program to compute and print the number of miles a car has travelled during 2013 and compute the average litre comsumption per mile. the program shouls ask for daily number of miles, also give its output the total amount spent on petrol for the year.

Recommended Answers

All 2 Replies

There is no question here. Please start working on it yourself and when you run into a problem, then ask a question.

Also, there are a few problems with this idea in general, you are not able, from just the number of miles the car has travelled during 2013 ascertain the amount of fuel it has used, the average fuel consumption, and the amount spent on petrol.

If you know the amount of miles, the average cost of fuel that year and the average fuel consumption of that car you can give an estimate of how much may have been used on fuel throughout the year.

But the way you have worded it describes what is an essentially an impossible problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.