Thursday, November 21, 2013

                           Program that calculate total income of the year


#include <iostream>

using std::cout;
using std::endl;

int main ()
{

    const int salary = 20000;


    float tax = (float) 10 / 100 * salary; 

           
    float monthlyIncome = salary - tax;

    float yearlyBonus = (float) 5 / 100 * salary;


    float yearlyIncome = (monthlyIncome*12) + yearlyBonus;

    cout << "My yearly income is " << yearlyIncome << endl;

    return 0;
}

No comments:

Post a Comment