Program that asks the user to enter the number of miles

Assignment Help C/C++ Programming
Reference no: EM13163438

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:
8.2
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: EM13163438

Questions Cloud

State dicyanoethylene into symmetric sterioisomers : Please Solve these with step by step instructions with phases. It is very hard to understand how to solve them without a photograph and an explanation of why you chose each step
Calculate the partial pressure of each gas : Assuming that the total pressure of the gases is 1.52 and that their mole ratio is 94 : 4.0 : 1.5 : 0.50, calculate the partial pressure (in atmospheres) of each gas.
What partial pressure of will be present in the vessel : If a 1.7 reaction vessel initially contains 730 of at 25 , what partial pressure of will be present in the vessel after 200 minutes?
Assume that section : Assume that section _1 seats are in front of the stage, and the price is expensive. say, each seat in the 1st three rows is $180.00, and each seat in the last two rows is 10% less;
Program that asks the user to enter the number of miles : 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.
Use heat of formation data to determine h : Use heat of formation data to determine H for the combustion of hydrogen sulfide according to the following reaction: 2 H2S(g) + 3 O2(g) ? 2 SO2(g) + 2 H2O(?) ?H = ? ?Hfo for compounds:
Calculate deltahrxn : Calculate DeltaHrxn for the following reaction: CH4(g) + 2Cl2 (g) --- CH2Cl2(g) + 2HCl(g) Use the following reactions and given delta H's
Project will be a simple, working program : This programming project will be a simple, working program, using Python language, which utilizes a good design process and includes:Sequential, selection, and repetitive programming statements as well as,At least one function call.
Implement a standard sorted linked list class : Write C++ Program:Implement a standard SORTED linked list class. Be sure to include constructor/copy constructor, destructor, and assignment operator overload.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

  Using opengl to create a cube

Write a program in C/C++ using OpenGL to create (without using built in function) a cube by implementing translation algorithm by translating along 1. X-axis, 2.Y-axis and 3. X and Y plane

  Skills required by personnel working in information security

What skills are required by personnel working in information security? Write down some job titles in the field and come up with some required qualifications and some desirable qualifications.

  Sort an array of elements using the quick sort algorithm

Sort an array of 10,000 elements using the quick sort algorithm as follows: sort the array using pivot as the middle element of the array

  Design a nested program

How many levels of nesting are there in this design?

  Make 2-dimensional array

make 2-dimensional array a bit of life and bringing them from the abstract to the concrete realms

  Consists of an employee''s last name

Each input line consists of an employee's last name, first name, current base salary, total sales and percent commission. For example, in the first input line, the last name of the employee is Thomas, the first name is Andrew, the current base salary..

  Prevent illegal moves without crashing

Your program must gracefully handle the case when a player tries to add a non-number to a square, or add a number that violates the Sudoku rules. It should prevent illegal moves without crashing.

  Write a program code to compute and build a table of reynold

Write a program code to compute and build a table of Reynolds numbers at flow velocities varying from 100 to 1000 ft/sec (at increments of 100)

  Write test program to call function several times for gcd

Greatest common divisor of two integers is largest integer which will evenly divide both integers. Implement this function in assembly language and write test program which calls function several times, passing it different values.

  Write the code

Write a program that allows an instructor to keep a grade book. Each students has scores for exams, homework assignments, and quizzes.

  Create a text file named grades.txt

Write a program to calculate students' average test scores and their grades. Creat a text file named  grades.txt

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