- Joined
- Sep 5, 2007
- Messages
- 512 (0.08/day)
System Name | HAL_9017 |
---|---|
Processor | Intel i9 10850k |
Motherboard | Asus Prime z490-A |
Cooling | Corsair H115i |
Memory | GSkill 32GB DDR4-3000 Trident-Z RGB |
Video Card(s) | NVIDIA 1080GTX FE w/ EVGA Hybrid Water Cooler |
Storage | Samsung EVO 960 M.2 SSD 500Gb |
Display(s) | Asus XG279 |
Case | In Win 805i |
Audio Device(s) | EVGA NuAudio |
Power Supply | CORSAIR RM750 |
Mouse | Logitech Master 2s |
Keyboard | Keychron K4 |
Hello Agian everyone.
I'm not to sure what could be doing this, as to me, it looks right. This is another assignment for entry C++. I know I sound like a newb asking for help agian, but then agian, what are forums for at time lie this?
Now, I have to use value returning functions in this assignment. I need to have the functions as main(), getHoursWorked(), getPayRate(), and calcGross() all together to calculate someones paycheck for the week.
So this sounds like a simple "Pay = hours * rate", just a little overdone (if you ask me. Then again, I don;t know better at this point, so if I'm jumping the gun, please let me know)
So I get all my kinks worked out, except this one line where I do the calculations for calcGross(). I have 2 errors from my build log. They say this:
error C2296: '*': illegal, left operand has type 'double(_cdecl*)(void)'
error C2297: '*': illegal, right operand has type 'double(_cdecl*)(void)'
Now, I'm not sure why I'm getting this. My arithimtic setup looks correct to me, so why would I get this?
I'm using Microsoft C++ Visual Studio Express 2005 for reference.
Now for the moment of joy:
Thank you all for helping.
P.S. - I was not sure to post this in my last thread, or make a new one. I figured, well, new problem and situation, which altogether is a different topic, so new thread. If I am wrong, pleas correct me too.
I'm not to sure what could be doing this, as to me, it looks right. This is another assignment for entry C++. I know I sound like a newb asking for help agian, but then agian, what are forums for at time lie this?
Now, I have to use value returning functions in this assignment. I need to have the functions as main(), getHoursWorked(), getPayRate(), and calcGross() all together to calculate someones paycheck for the week.
So this sounds like a simple "Pay = hours * rate", just a little overdone (if you ask me. Then again, I don;t know better at this point, so if I'm jumping the gun, please let me know)
So I get all my kinks worked out, except this one line where I do the calculations for calcGross(). I have 2 errors from my build log. They say this:
error C2296: '*': illegal, left operand has type 'double(_cdecl*)(void)'
error C2297: '*': illegal, right operand has type 'double(_cdecl*)(void)'
Now, I'm not sure why I'm getting this. My arithimtic setup looks correct to me, so why would I get this?
I'm using Microsoft C++ Visual Studio Express 2005 for reference.
Now for the moment of joy:
Thank you all for helping.
P.S. - I was not sure to post this in my last thread, or make a new one. I figured, well, new problem and situation, which altogether is a different topic, so new thread. If I am wrong, pleas correct me too.
//Lab 3 by <<<<<< ENTER NAME HERE >>>>>>>>>
//ITCS 1214
#include <iostream>
#include <iomanip>
using std::cin;
using std::cout;
using std::endl;
using std::fixed;
using std::setprecision;
//function pronotypes
double getHoursWorked();
double getPayRate();
double calcGross();
int main()
{
//input variables
double totalPay = 0.0;
totalPay = calcGross();
cout << fixed << setprecision(2) << "Total Pay for this week is: $" << totalPay << endl;
return 0;
}//end of main function
//******function definitions******
double getHoursWorked()
{
//variables for hours worked
double hoursWorked = 0.0;
cout << "How many hours did the employee work this week?: ";
cin >> hoursWorked;
return hoursWorked;
}//end of getHoursWorked
double getPayRate()
{
double payRate = 0.0;
cout << "What is the employee's payrate?: $";
cin >> payRate;
return payRate;
}//end getPayRate function
double calcGross(double hoursWorked, double payRate)
{
double gross = 0.0;
gross = (getHoursWorked) * (getPayRate);
return gross;
}//end calcGross function