Good day everyone, Our class has not yet learned about loops, and we have only learned If statements. Professor has assigned a tax calc, but from what I have been reading online is hard for me to understand as I am very novice at programming. I am having trouble getting my numbers to come out in a dollar format, ex: 50000 = $50,000 Any and all tips are appreciated even if it doesn't have to do with the subject. Here is what I have written so far:
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main()
{
int iNCOME;
cout << "Good day Sir/Madam, we noticed your filing status is: Single.For tax purposes, what is your yearly income?";
cin >> iNCOME;
cout << " You entered: $" << iNCOME << endl;
if (iNCOME <= 9325)
{
cout << "Your income puts you in the 10% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.1;
}
else if ((iNCOME >= 9326) && (iNCOME <= 37950))
{
cout << "Your income puts you in the 15% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.15;
}
else if ((iNCOME >= 37951) && (iNCOME <= 91900))
{
cout << "Your income puts you in the 25% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.25;
}
else if ((iNCOME >= 91901) && (iNCOME <= 191650))
{
cout << "Your income puts you in the 28% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.28;
}
else if ((iNCOME >= 191651) && (iNCOME <= 416700))
{
cout << "Your income puts you in the 33% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.33;
}
else if ((iNCOME >= 416701) && (iNCOME <= 418400))
{
cout << "Your income puts you in the 35% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.35;
}
else if (iNCOME >= 418401)
{
cout << "Your income puts you in the 39.60% Tax Bracket" << endl << "Your taxes are: $" << iNCOME * 0.396;
}
return 0;
}