hi i just started to learn c++. I'm trying to figure out how to make a variable change depending on another variable. It shows a strange answer when i try it idk where its getting it from. anyways i'll just put my code in here and hope someone understands what i am doing.
#include <iostream>
long int mult (float hours,float payrate,float tax,float overtimerate,float overtimehours,float overtimeday,float insurance);
int main()
{
float insurance;
float hours;
float payrate;
float tax;
float overtimerate;
float overtimehours;
float overtimeday;
insurance=.81;
overtimehours=0;
overtimerate=1.5;
tax=4.93372123545367;
std::cout<<"Paycheck calculator\n";
std::cout<<"Enter your hours\n";
std::cin>>hours;
std::cin.ignore();
std::cout<<"Did you work over 8 hours in a day?\n If so enter how much? If none enter 0\n";
std::cin>>overtimeday;
if (hours>80)
{
overtimehours=((hours - 80)+overtimeday);
}
std::cout<<overtimehours+overtimeday<<"\n";
std::cout<<"Enter your pay rate\n";
std::cin>>payrate;
std::cin.ignore();
std::cout<<"Your paycheck should be approximately: "<<((overtimeday+overtimehours)*(overtimerate*payrate
))+(((hours-overtimehours)*payrate)-((((hours-(overtimeday+overtimehours))*payrate)/tax)
-insurance))<<"\n";
}