Advertisements

C++ program "Rent for your entire life"

#include <iostream>
#include <cmath>

using namespace std;

int main()

{
   int rent, years, age;
   float cost1, months, result1, result2, result3, result4, life;
  
   cout <<“plese enter your age:” << endl;
   cin >> age;

   cout << “plese enter the cost of your rent:” << endl;
   cin >> cost1;

   cout << “enter the number of months left in your lease, or mortgage:” <<endl;
   cin >> months;

   cout << “the amount you will pay over the remainder of your lease or mortgage is:”  << endl;
   result1 = cost1 * months;
  
   cout << result1 << endl;

   cout << “The average life expectancy is 78.1 years;” << endl;
   cout << “The average age of a first time home owner is currently 38 years old” << endl;
   cout << “The amount of money you will pay through out the rest of your life \n(estimated) is:” << endl;
   result3 = age -78.1;
   life = abs(result3);
   result4 = life * 12 * cost1;
   cout << result4 <<endl;
   
  

   cin.get();
   cin.ignore();  
   cout << “Now you know how much money you are spending on living arrangements:”<<endl;
   system (“pause”);
   return 0;

}

Advertisements

About Rant4u

A Revolution in Social Networking

Posted on February 16, 2012, in # code, #c++, #computer code, #rant-4u, #rent for life program. Bookmark the permalink. 1 Comment.

  1. Seems like a code that will work.

    Like

Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: