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

  A series of one-digit non-negative numbers

Write a program that asks the user to enter a series of one-digit non-negative numbers

  Create a program for a company named retail-mart

Prompt the user to enter an item name (one word only), a quantity and a price. For this step, in addition to functionality, I'll be looking at: location of the variable declarations; appropriateness of data types selected; appropriateness of the va..

  Write program in c to calculate diameter-compression load

Write a program in C to calculate diameter in centimeters of steel rod, an aluminum rod, and a copper rod, which can withstand a particular compression load.

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Add 10 people to the line

Add 10 people to the line and process them. Each time you process someone, print out their ticket information. After all 10 have been serviced, print the average wait time. Below is an example of the time calls you will need and a wait function.

  Multiple heaps

Create an application that has two heaps. Place a linked list into each heap. Select one hundred random numbers. Place each of the random numbers into each heap - CSI 345 - Spring 2014 S2

  Write a program to find that number for nguyen.

In some Asian countries, 8 and 6 are considered lucky digits. Any number containing only 8s and 6s is considered lucky number, e.g. 6, 8, 66, 668, 88, 886 .... Nguyen is a student who likes mathematics very much. Nguyen likes lucky numbers but only o..

  Write a very basic doubly-linked list

CptS 122 Lab #2: Linked Lists ,  Along with vectors, linked lists are one of the fundamental data structures in computer science. Unlike vectors, which store information in a contiguous block of computer memory, linked lists have the potential to sto..

  Cashregister class that can be used with the retailitem clas

Write a CashRegister class that can be used with the RetailItem class that you wrote in Part 1. The CashRegister class should simulate the sale of a retail item. It should have a constructor that accepts a RetailItem object as an argument.

  Write recursive boolean method to accept array and value

Write down the recursive boolean method named isMember. The method must accept two arguments: an array and a value. Method must return true if value is found in array.

  Binary tree, print right view of it

Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.

  Change this code to read in strings from a text file

code takes in a string from a user, checks if the paranthesis are ballanced (as defined by my class) and also returns the variable from my line (also from my class). All like to change this code to read in strings from a text file (each line is a str..

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