Jan 30, 2016 at 8:53pm Jan 30, 2016 at 8:53pm UTC
Hi i am having trouble figuring out why it doesn't show my display when I run my program can somebody point me in the right direction of what I'm doing wrong?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
#include <iostream>
#include<iomanip>
using namespace std;
float getMonthlyIncome()
{
float income;
cout << "\tYour monthly income: " ;
cin >> income;
return income;
}
float getBudgetedLiving()
{
float budgetedliving;
cout << "\tYour budgeted living expenses: " ;
cin >> budgetedliving;
return budgetedliving;
}
float getActualLiving()
{
float actualLiving;
cout << "\tYour actual living expenses: " ;
cin >> actualLiving;
return actualLiving;
float getActualTaxes()
{
float actualTaxes;
cout << "\tYour actual taxes withheld: " ;
cin >> actualTaxes;
return actualTaxes;
}
float getActualTithe()
{
float actualTithe;
cout << "\tYour tithe offerings: " ;
cin >> actualTithe;
return actualTithe;
}
float getOther()
{ float other;
cout << "\tYour actual other expenses: " ;
cin >> other;
return other;
}
void display(float income, float budgetedLiving, float actualLiving, float actualTaxes, float actualTithe, float other)
{
cout << "\n" << "The following is a report on your monthly"
<< " expenses\n" ;
cout.setf(ios::fixed); // no scientific notation please
cout.setf(ios::showpoint); // always show the decimal for real numbers
cout.precision(2); // two digits after the decimal
cout << "\tItem Budget Actual\n" ;
cout << "\t=============== =============== ===============\n" ;
cout << "\tIncome $" << setw(11) << income << " $" << setw(11) << income <<"\n" ;
cout << "\tTaxes $" << setw(11) << 0.00 << " $" << setw(11) << actualTaxes <<"\n" ; //displays budget table using variables
cout << "\tTithing $" << setw(11) << 0.00 << " $" << setw(11) << actualTithe <<"\n" ;
cout << "\tLiving $" << setw(11) << budgetedLiving << " $" << setw(11) << actualLiving << "\n" ;
cout << "\tOther $" << setw(11) << 0.00 << " $" << setw(11) << other << "\n" ;
cout << "\t=============== =============== ===============\n" ;
cout << "\tDifference $" << setw(11) << 0.00 << " $" << setw(11) << 0.00 << "\n" ;
}
int main()
{
cout << "This program keeps track of your monthly budget\n" //Greeting
<< "Please enter the following:\n" ;
float income = 0;
income = getMonthlyIncome(); // variable for income function
float budgetedLiving = 0;
budgetedLiving = getBudgetedLiving(); // variable for budgeted living function
float actualLiving = 0;
actualLiving = getActualLiving(); // variable for actual living function
float actualTaxes = 0;
actualTaxes = getActualTaxes(); // variable for actual taxes function
float actualTithe = 0;
actualTithe = getActualTithe(); // variable for actual tithe function
float other = 0;
other = getOther(); // variable for other function
void display(float income, float budgetedLiving, float actualLiving, float actualTaxes, float actualTithe, float other);
return 0;
}
Last edited on Jan 30, 2016 at 9:08pm Jan 30, 2016 at 9:08pm UTC