variables_cin

variables_cin - cin>> numGallons computations...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 // class 2 demo 2 // Mr Minich #include <iostream> using namespace std int main() { // ************** declaration statements *********** int numGallons = 0 i double gasPrice = 3.00 const double GAS_TAX = 0.33 double totalPrice = 0.0 // ************** user input *********************** cout << "Please enter the number of gallons: "
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cin >> numGallons // ************** computations ********************* totalPrice = (numGallons * gasPrice) + (numGallons * GAS_TAX) // ************** output display ******************* cout << "The total price is $" << totalPrice << endl return 0 }// end of main...
View Full Document

This note was uploaded on 04/01/2008 for the course CMPSC 101 taught by Professor Drobish,renee during the Spring '07 term at Penn State.

Ask a homework question - tutors are online