# assignment11 - s int year, mileage, months, endmilesfirst,...

This preview shows pages 1–2. Sign up to view the full content.

/* Write a program which processes a loan for a car. Look at the sample session below and write your program to mimic this behavior. Make sure to store information in appropriately-named variables (Green text is user input). What is the make of the car? Ford What is the model of the car? Taurus What is the year of the car? 2005 What is the mileage of the car (no tenths)? 47675 What is the cost of the car? 9900.00 How many months for the loan? 36 Your 2005 Ford Taurus costs \$10494 after sales tax and will cost you 291.5 per month for 36 months. When it is paid off, you will probably have 83675 miles on it. Note that this program works on a payment plan with zero interest (a good deal if you can get it!), that the sales tax is fixed at 6%, and that it assumes you will drive it an average of 1000 miles per month.*/ m #include<iostream> #include<string> using namespace std; u int main () i { string make,model;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: s int year, mileage, months, endmilesfirst, endmilessecond; i double cost,tax,morethan, total, permonth; d cout<< "What is the make of the car? "; cin>> make; cout<< "What is the model of the car? "; cin>> model; cout<< "What is the year of the car? "; cin>> year; cout<< "What is the mileage of the car (no tenths)? "; cin>>mileage; cout<< "What is the cost of the car? "; cin>>cost; cout<< "How many months for the loan? "; cin>>months; c tax = .06; morethan = cost * tax; total = cost + morethan; t permonth = total / months; p endmilesfirst = months * 1000; endmilessecond = endmilesfirst + mileage; e cout << "Your " <<year<< " " <<make<< " " <<model<< " costs \$" << total << " after sales tax and will cost you " << permonth << " per month for " <<months<< " months. When it is paid off, you will probably have " << endmilessecond<< " miles on it." <<endl; w }...
View Full Document

## This note was uploaded on 01/11/2010 for the course CMPSC 101 taught by Professor Drobish,renee during the Summer '07 term at Pennsylvania State University, University Park.

### Page1 / 2

assignment11 - s int year, mileage, months, endmilesfirst,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online