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

  Least number of comparisons needed

What is the least number of comparisons needed to sort an array of 6 numbers, in the worst case, using any sorting algorithm that sorts with binary comparisons? Explain

  Problems on oops

Problems on OOPS

  Insert the missing code in the c program

You are to insert the missing code in the C program given for combinational equivalence checking. This program will interface with the CUDD package and will parse netlist files in ISCAS85 circuit format. Next, BDDs will be created for each circuit an..

  Program that asks the user to enter up to 100 integer score

Write a C program that asks the user to enter up to 100 integer scores, which are to be stored in an array. (You should allow the user to terminate input prior to entering all 100 scores.) The program should then display all the scores, ten per line,..

  Program to compute the total volume

Write a program to compute the total volume for a number of cylinders. A cylinder may have different values for height and radius.

  C assignment of curl library

C Assignment Curl library must be used To be done on linux, it should be compiled using the following command: gcc -Wall -ansi -pedantic NameOfFile.c -lncurses Please make sure it is commented with clarification Variable names in camel case

  Create class has three pieces of information as data members

Create a class called Date in C++ that includes three pieces of information as data members: month (type int), day (type int) and yaer (type int).

  Construct vector and linked lists data structures

You will prepare sorted versions of the Linked Lists and Vector data structures developed in class

  Define two derived classes of the abstract class

Define two derived classes of the abstract class ShapeBase below. Your two classes will be called RightArrow and LeftArrow. These classes will draw arrows that point right and left,

  Write c program which compute acceleration of jet fighter

Write a C++ program which compute the acceleration (m/s 2) of jet fighter launched from aircraft-carrier based catapult, provided jet's takeoff speed in km/hr

  The funtion should take as parameters

Write a function in c ++ that multiplies two functions. the funtion should take as parameters two fraction structures. Then, the function should multiply the two fractions and return the solution as a fraction structure.

  Write a program that takes a positive integer

Write a program that takes a positive integer from the user and prints the rightmost digit of that integer. This is a sample output: Enter an integer: 1247

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