nooo no its ok i got it to work
the teacher also wanted to make it work with decimals so no int only double. it looks like this and works fine!
/*----------------------------------------------------------------------------------
Source file: mainsource.cpp
Author: ----
Compiler: Bloodshed Dev-C++ 4.9.9.2
Purpose: Program to calculate a salesperson's net pay for a month and print a budget
report based on given allocations.
-----------------------------------------------------------------------------------*/
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main ()
{
string fname, lname;
double totalms, npay, gpay, deduct, comm = 0, house, foodc, entert, misc;
const int basepay = 900;
// End user inputs his first name, last name and total monthly sales.
cout << endl << "Please enter your first name (with no spaces): ";
cin >> fname;
cout << endl << "Please enter your last name (with no spaces): ";
cin >> lname;
cout << endl << "Please enter your total monthly sales: $";
cin >> totalms;
// Perform calculations for budget report.
if (totalms > 200) {
if((fmod(totalms,200))==0) {
comm = ((totalms-200)/100) * 6;
}
else {
comm = floor(totalms/200) * 12;
}
}
else
{
comm = 0;
}
gpay = basepay + comm;
deduct = gpay * .18;
npay = gpay - deduct;
// Perform calculations for budget allocation.
house = npay * .30;
foodc = npay * .15;
entert = npay * .50;
misc = npay * .05;
// Result displayed on a table format.
cout << endl << endl << endl << "BUDGET REPORT FOR: " << fname << " " << lname << endl << endl;
cout << "Base Pay Sales Commission Gross Pay Deductions" << endl;
cout << " 900 " << " " << totalms << " " << comm << " " << gpay << " " << deduct << endl << endl;
cout << "Net pay: $" << npay << endl << endl;
cout << "BUDGET ALLOCATIONS:" << endl;
cout << "Housing = " << house << endl;
cout << "Food/Clothing = " << foodc << endl;
cout << "Entertainment = " << entert << endl;
cout << "Miscellaneous = " << misc << endl;
cout << "\n \nPlease press the key 'enter' to end the program!";
cin.ignore(2);
return 0;
}