Ch4_8 - while(t==true cout<<"Enter price of the...

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

View Full Document Right Arrow Icon
#include <iostream.h> #include <conio.h> /************************************************** Name: Hung Truong Program: Ch4_8: Cost of the house for first year Instructor: Mr. Barkeshli Purpose: Input: Price of the house and down payment Output: Cost of it **************************************************/ bool t=true; char c; double price,dpay,iloan,amg,txsave; double a_mortgage(double loan); //Calculate annual mortgage cost double tax_saving(double loan); //Calculate tax saving main() { cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(3);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: while (t==true) { cout<<"Enter price of the house: ";cin>>price; cout<<"Enter down payment: ";cin>>dpay; /*********************************************/ iloan=price-dpay; amg=a_mortgage(iloan); txsave=tax_saving(iloan); cout<<"Cost of the house for first year: "<<amg-txsave<<endl; cout<<"You want to do it again(Y/N)? ";cin>>c; t=(c=='Y')|(c=='y'); } } double a_mortgage(double loan) { return (loan*9/100); } double tax_saving(double loan) { double temp; temp=loan*6/100; return temp*35/100; }...
View Full Document

This note was uploaded on 03/20/2011 for the course CS 2 taught by Professor Barkeshli during the Spring '11 term at Pasadena City College.

Ask a homework question - tutors are online