So, i am trying to get this code to work....... but for all four of my functions
ID: 2247650 • Letter: S
Question
So, i am trying to get this code to work....... but for all four of my functions it says that the "function does not take 1 arguement" for the all 4 of the functions some of them say "function doesn not take 3 arguements" but i dont know what it means put can someone help me get this code right please please let me know if you need more information
#include "stdafx.h"
#include <iostream>
using namespace std;
float getSalesAmt(float a); // function proto
float calcCommision(float a, float b, double c, double d); // function proto
float calcPay(float b, int e, float f); // function proto
float displayPay(float a, float b, int e, float f); // function proto
int main()
{
float monthlySales = 0; // A
float commision = 0; // B
double //C // this is the percentage for the commision when sales are between 25000 and 50000
double two = 0.02; //D // this is the percentage for commision when sales are over 50000
int basePay = 2500; // E
float totalPay = 0; //F
getSalesAmt(monthlySales);
calcCommision(monthlySales, commision, onehalf, two);
calcPay(commision, basePay, totalPay);
displayPay(monthlySales, commision, basePay, totalPay);
return 0;
}
float getSalesAmt(float a)
{
cout << "Enter the monthly sales amount: ";
cin >> a;
return 0;
}
float calcCommision(float a, float b, double c, double d)
{
if(a > 50000)
{
b = a * c;
}
if (a > 25000 && a < 50000)
{
b = a * d;
}
if (a < 25000)
{
b = 0;
}
return b;
}
float calcPay(float b, int e, float f)
{
f = b + e;
}
float displayPay(float a, float b, int e, float f)
{
cout << "Monthly Sales: $" << a << " ";
cout << "Commission: $" << b << " ";
cout << "Base Pay: $" << e << " ";
cout << "Total Pay: $" << f << " ";
}
Explanation / Answer
Program:
#include <iostream>
using namespace std;
float getSalesAmt(float a); // function proto
float calcCommision(float a, float b, double c, double d); // function proto
float calcPay(float b, int e, float f); // function proto
float displayPay(float a, float b, int e, float f); // function proto
int main()
{
float monthlySales = 0; // A
float commision = 0; // B
double //C // this is the percentage for the commision when sales are between 25000 and 50000
double two = 0.02; //D // this is the percentage for commision when sales are over 50000
int basePay = 2500; // E
float totalPay = 0; //F
monthlySales=getSalesAmt(monthlySales);
commision=calcCommision(monthlySales, commision, onehalf, two);
totalPay=calcPay(commision, basePay, totalPay);
displayPay(monthlySales, commision, basePay, totalPay);
return 0;
}
float getSalesAmt(float a)
{
cout << "Enter the monthly sales amount: ";
cin >> a;
return a;
}
float calcCommision(float a, float b, double c, double d)
{
if(a > 50000)
{
b = a * c;
}
if (a > 25000 && a < 50000)
{
b = a * d;
}
if (a < 25000)
{
b = 0;
}
return b;
}
float calcPay(float b, int e, float f)
{
f = b + e;
return f;
}
float displayPay(float a, float b, int e, float f)
{
cout << "Monthly Sales: $" << a << " ";
cout << "Commission: $" << b << " ";
cout << "Base Pay: $" << e << " ";
cout << "Total Pay: $" << f << " ";
}
Output:
Enter the monthly sales amount:100000
Monthly Sales: $100000
Commission: $1500
Base Pay: $2500
Total Pay: $4000
//I think this is far enough
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.