assignment15 - # using namespace std; u int main () { double

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

View Full Document Right Arrow Icon
/* Write a program that calculates your return-on-investment for purchasing a house. The return-on-investment is calculated by dividing the total profit by the purchase price. For example, a house that cost $100,000 today and is sold for $105,000 in one year has a return-on-investment of $5,000/$100,000 or 5% per year. If it took two years for the property to sell for $105,000 then the return-on-investment would be 2.5% per year. Use the following screen shots as a guide.*/ t #include<iostream> #include<string>
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: # using namespace std; u int main () { double housecost,saleprice,combinedcost,peryear,roi,roifinal; int years; cout << "What is the cost of the property? "; cin >> housecost; cout << "What is the sale price of the property? "; cin >> saleprice; cout << "How many years? "; cin >> years; c combinedcost = saleprice - housecost; peryear = combinedcost / housecost; roi = peryear/years; roifinal = roi * 100; r cout << "The ROI for this house is " <<roifinal<< "% per year." << endl; c }...
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.

Ask a homework question - tutors are online