I am writing a code that requires the three functions listed. I keep getting the following error messages and I absolutely do not know what to do. Any help is appreciated!!
Error 6 error C2082: redefinition of formal parameter 'commissionOwed' c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 42 1 Chp 10 Commiss Lab Test
Error 2 error C2440: '==' : cannot convert from 'double (__cdecl *)(double)' to 'double' c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 17 1 Chp 10 Commiss Lab Test
Error 4 error C2440: '==' : cannot convert from 'double (__cdecl *)(void)' to 'double' c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 18 1 Chp 10 Commiss Lab Test
Error 1 error C2446: '==' : no conversion from 'double (__cdecl *)(double)' to 'double' c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 17 1 Chp 10 Commiss Lab Test
Error 3 error C2446: '==' : no conversion from 'double (__cdecl *)(void)' to 'double' c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 18 1 Chp 10 Commiss Lab Test
Error 5 error C3861: 'displayCommission': identifier not found c:\users\alec\documents\visual studio 2013\projects\chp 10 commiss lab test\chp 10 commiss lab test\source.cpp 19 1 Chp 10 Commiss Lab Test
8 IntelliSense: cannot determine which instance of overloaded function "getCommission" is intended c:\Users\Alec\Documents\Visual Studio 2013\Projects\Chp 10 Commiss Lab Test\Chp 10 Commiss Lab Test\Source.cpp 18 20 Chp 10 Commiss Lab Test
7 IntelliSense: operand types are incompatible ("double" and "double (*)(double monthlySales)") c:\Users\Alec\Documents\Visual Studio 2013\Projects\Chp 10 Commiss Lab Test\Chp 10 Commiss Lab Test\Source.cpp 17 14 Chp 10 Commiss Lab Test
--------------------------------------------
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include<iostream>
#include<iomanip>
using namespace std;
//Function Prototype
double getMonthlySales(double);
double getCommission();
void diplayCommission(double commissionOwed);
int main()
{
//Declare Variables
double salesAmount = 0.0;
double commissionOwed = 0.0;
//Call Functions to Calculate the Employees Commission Owed
salesAmount == getMonthlySales;
commissionOwed == getCommission;
displayCommission(commissionOwed);
system("pause");
return 0;
}
//End of Main Function
//**Function Definitions**
double getMonthlySales(double monthlySales)
{
double salesAmount = 0.0;
cout << "Enter Your Total Monthly Sales :$" << endl;
cin >> salesAmount;
return salesAmount;
}
//End of Get Monthly Sales Function
double getCommission(double commissionOwed, double salesAmount)
{
double commissionOwed = 0.0;
if (salesAmount > 0 && salesAmount <= 19999)
commissionOwed = salesAmount*.04;
else if (salesAmount >= 20000 && salesAmount <= 29999)
commissionOwed = salesAmount*.05;
else if (salesAmount >= 30000 && salesAmount <= 39999)
commissionOwed = salesAmount*.06;
else if (salesAmount >= 40000 && salesAmount <= 49999)
commissionOwed = salesAmount*.07;
else (salesAmount >= 50000);
commissionOwed = salesAmount*.08;
return commissionOwed;
}
//End of Get Commission Function
void displayCommission(double commissionOwed)
{
cout << "Total Commission: $" << fixed << setprecision(2) << commissionOwed << endl;
}
//End of Display Commission Function
|