Hello all,
I am trying to get this program to work but all I keep getting is negative signs after the correct answers. Can someone please help me figure this out?
I am trying to just get the correct answers without the negative signs.
Thank you in advance
Code:
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
const double TaxRate= .14;
const double MyBond= .25;
const double ParentBond= .50;
int main()
{
//declaration section
double Gross, PSB, MSB, RemainingBalance, PayRate, NetIncome, FinalTotal, CExpense, SExpense, TaxWithheld, HoursWork, Week= 5;
cout<<fixed<<showpoint;
cout.precision(2);
//input section
cout<<"Please enter your pay rate"<<endl;
cin>>PayRate;
cout<<"Please enter the number of hours you worked each week"<<endl;
cin>>HoursWork;
//computation section
Gross= Week*HoursWork*PayRate;
TaxWithheld= Gross*TaxRate;
NetIncome= TaxWithheld-Gross;
CExpense= NetIncome*.10;
SExpense= NetIncome*.01;
RemainingBalance= CExpense+SExpense-NetIncome;
MSB=RemainingBalance*MyBond;
PSB=MSB*ParentBond;
FinalTotal= MSB-RemainingBalance;
//output section
cout<<"After working 5 weeks, you have Grossed: "<<Gross<<endl;
cout<<"Taxes Withheld: "<<TaxWithheld<<endl;
cout<<"Net Income: "<<NetIncome<<endl;
cout<<"Clothing Expense: "<<CExpense<<endl;
cout<<"Supplies Expense: "<<SExpense<<endl;
cout<<"Remaining Balance after Taxes&Expenses: "<<RemainingBalance<<endl;
cout<<"My Savings Bonds Contribution: "<<MSB<<endl;
cout<<"Parents Savings Bonds Contribution: "<<PSB<<endl;
cout<<"Final Total after Taxes, Expenses and Savings: "<<FinalTotal<<endl;
system("PAUSE");
return 0;
}