Hi there, been having some trouble with a simple program i am trying to write. I'm fairly new to C++, and can't seem to fix the errors im getting. Any ideas or hints would be much appreciated.
#include <iostream>
using namespace std;
int main()
{
double payrate;
double hours;
double overtimehours;
double overtimepay;
double totalpay;
cout << "How many hours did client work this week?" << endl ;
cin >> hours ;
cout << "What is their current payrate?" << endl ;
cin >> payrate ;
if (payrate < 10) && (hours > 40)
overtimehours = hours - 40 ;
overtimepay = overtimehours * 1.5 * payrate ;
totalpay = 40 * payrate + overtimepay ;
cout << "The client worked overtime, they are owed: $" << totalpay << endl ;
else
totalpay = hours * payrate ;
cout << "The client is owed: $" << totalpay << endl ;
return 0 ;
}
These are the errors im getting;
c:\documents and settings\owner\my documents\visual studio 2008\projects\practice\practice\payrate.cpp(18) : error C2143: syntax error : missing ';' before '&&'
c:\documents and settings\owner\my documents\visual studio 2008\projects\practice\practice\payrate.cpp(18) : warning C4390: ';' : empty controlled statement found; is this the intent?
c:\documents and settings\owner\my documents\visual studio 2008\projects\practice\practice\payrate.cpp(23) : error C2181: illegal else without matching if
Again, any hints in the right direction here are much appreciated.
-alias