I keep getting an output of zero, I don't know what's wrong..
#include <iostream>
using namespace std;
double determineCommissionRate(double totalCommission, double totalSales);
double determineBasePay(double basePay, double yearsWorked);
int main()
{
double yearsWorked, totalSales, totalPay, totalCommission, basePay;
cout << "Please enter the number of years you have worked at this company" << endl;
cin >> yearsWorked;
cout << "Please enter the total amount of sales, in dollars, generated for the month" << endl;
cin >> totalSales;
totalPay = totalCommission + basePay;
cout << "Your total pay is " << totalPay << endl;
return 0;
}
double determineCommissionRate(double totalCommission, double totalSales)
{
if (totalSales <= 5000)
{
totalCommission = totalSales * .025;
}
else if ((totalSales >= 10000) || (totalSales < 5000))
{
totalCommission = totalSales * .0325;
}
else if ((totalSales >= 20000) || (totalSales < 10000))
{
totalCommission = totalSales * .0450;
}
else if ((totalSales >= 40000) || (totalSales < 20000))
{
totalCommission = totalSales * .0650;
}
else if (totalSales > 40000)
{
totalCommission = totalSales * .0925;
}
else
{
cout << "That is not a proper amount, please try again. " << endl;
}
return (totalCommission);
}
double determineBasePay(double basePay, double yearsWorked)
{
if ((yearsWorked >= 1) || (yearsWorked < 5))
{
basePay = 500;
}
else if (yearsWorked >= 5)
{
basePay = 1000;
}
else
{
basePay = 0;
}
return (basePay);
}