Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in liters/200km[for odd roll numberstudents]) as my roll no is odd. Program must be in C language not in c++ Must use user define function

image text in transcribed

in liters/200km[for odd roll numberstudents]) as my roll no is odd. Program must be in C language not in c++ Must use user define function where required. Hoping for a quick reply.

Because of the high price of petrol, you are concerned with the fuel consumption of your car. As a result, you have a record of the kilometers driven and liters used for each tank of petrol you purchase. Write a program that will display the kilometers driven, liters used, and consumption (in liters /100 km (for even roll number students]) (in liters /200 km [for odd roll number students]) for each tankful. After processing all the input information, the program should calculate the overall average consumption. Construct the User-defined function to calculate overall average consumption. Sample Output: Enter the liters used (-1 to end): 57.6 Enter the kilometers driven: 459 The liters/100km for this tank was 12.5 Enter the liters used (-1 to end): 45.3 Enter the kilometers driven: 320 The liters/100km for this tank was 14.2 Enter the liters used (-1 to end): -1 The overall average consumption was: 13.4

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Explain how labour relations practices differ around the world.

Answered: 1 week ago

Question

help Select all of the functional groups in the following compound

Answered: 1 week ago