Calculate and display the miles-per-gallon value

Assignment Help Computer Engineering
Reference no: EM13713052

You have to evaluate and show the miles-per-gallon value. Confine your output to 1 decimal place.

Question- Write a C - program that asks the user to enter the number of miles traveled and the number of gallons of gasoline consumed. It should then calculate and display the miles-per-gallon value. Confine your output to 1 decimal place.

Next, using the fact that one gallon is about 3.785 liters and one mile is about 1.609 kilometers, it should convert the mile-per-gallon value to a liters-per-100-km value, the usual European way of expressing fuel consumption, and display the result, showing 2 decimal places. Use symbolic constants (using const or #define) for the two conversion factors in your program.

Example output (user input is bold):

Please enter the number of miles:

Please enter the number of gallons of gasoline consumed:

0.5 Your fuel consumption is 16.4 mile-per-gallon.

In the European scheme it is 14.34 liters-per-100-km.

Reference no: EM13713052

Questions Cloud

Design your own three-stage explicit runge-kutta method : Design your own three-stage explicit Runge-Kutta method with one-step error O(h^4) - Confirm that the global error in your numerical solution is O(h^3).
Computes the amount of money the computer club : Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project.
Evaluate the tip amount that should be added : Write a program that will be used to evaluate the tip amount that should be added to a restaurant charge. Allow the user to input the total, before taxes and the tip percentage (15% or 20%).
Write a program which adds two matrices : Write a program which adds two matrices together and displays the sum - Two arrays will contain user input, and the third array will be used to contain the sum of the two arrays.
Calculate and display the miles-per-gallon value : Program that asks the user to enter the number of miles traveled and the number of gallons of gasoline consumed. It should then calculate and display the miles-per-gallon value. Confine your output to 1 decimal place.
Describe the characteristics of laminar airflow : Describe the characteristics of laminar airflow in the boundary layer. Explain in brief of the above problem.
Program that allows users to enter a dollar amount : Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month. Then ask the user to enter a dollar amount for any number of checks written in a month, up to 50.
Write a recursive and iterative versions of binary search : In C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1 and the given test method:
Find cfgs for the languages : Find CFGs for the languages over the alphabet sigma = {a   b}:

Reviews

Write a Review

Computer Engineering Questions & Answers

  Software engineering and microprocessor systems

Software is required for a simple house burglar alarm system.

  Write down a program called tripper.cgi

Write down a program called tripper.cgi that will ask the user the number of miles he has driven and the amount of gas he used. In the tripper script, write a subroutine called mileage that would calculate and return the user's mileage (miles per ..

  Write down the syntax using a loop to print out

Write down the syntax (one line) to declare an int array with 7 values which are all 10.

  Develop an automated case tracking system

You are a systems development consultant who has been approached by a client, a law firm, to develop an automated case tracking system. The first step is to negotiate the project scope.

  Developing the algorithm and analyzing its running time

Katt wishes you to develop an algorithm that, provided a string X, computer efficiently how many ways X can be broken up into the sequence of words.

  List and briefly explain the five-component model of an

list and briefly explain the five-component model of an information system. how can you use them?your response should

  Review the agile and systems development life cycle sdlc

question 1. review the agile and systems development life cycle sdlc software development methodologies in your

  What benefits does active directory provide for managing

parsons lights manufactures natural lighting fixtures sold throughout north america. the users in the manufacturing and

  Deploy your app to gae in order to run asynchronous tasks

Create a cloud app (using Google App Engine) that does the following.

  Identify various considerations involved in planning

Further, these systems are also accessed using mobile computers such as the iPads. The CEO would like to develop a complete set of hardware, telecommunication and Human Resource Infrastructure for the purpose of developing the HIS planned in Journ..

  List possible objects in the book-store operation

the bookstore staff at pleasant creek community college works hard to satisfy students instructors and the schools

  Create a class named order that performs order processing

Create a class named Order that performs order processing of a single item that sells for $19.99 each.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd