Here is my code for a project for school. Simply enter the number of hours worked in a day, and the program tells you your daily wage, including overtime.
I have an issue with the Logical Errors, it's not working for some reason. I'm probably missing something very obvious and am just not seeing what it is, if someone could just look at it and let me know that would be great!
//Taylor Lynch
//Bus1
//Calculate the money made by a bus driver with the number of hours entered
//Period 5
#include <conio.h>
#include <iostream.h>
#include <dos.h>
main()
{
clrscr();
float hours, cash, cash2;
cprintf("Please enter the number of hours you work in a day ");
cin>>hours ;
if(hours<=8&hours>=1)
{
cash=hours*10 ;
cprintf("The total amount of money made today was $%.2f. ", cash);
}
if(hours>8&hours<=24)
{
cash2=(hours-8)*15+80;
cprintf("The total amount of money made today was $%.2f. ", cash2);
}
if(hours<1||hours>24)
{
cprintf("Please enter a number between 1 and 24");
}
getch();
return 0;
}