ok know it will exacut till pay input
OK. The info up to here has been grate I am learning a lot more from talking to people than this trial and error that I had been using, So here is the problem untill the salection of the pay rate it is runing fine. (it did Compile) but I get nothing after the reqest of the pay rate.
Code:
#include <stdio.h>
int main (void)
/*Using comp. Dev C/C++ information searched on the net on case structure and printf usage along with sugestions
from programing sites like program basics and cprograming, I have put togeather this file.*/
{
char name [30];
int pay = 0; /*selected from case group by alph corispondant # */
int hours = 0; /*user input with if elas statments */
int hlhrs = 0; /*user input in conjunction with the if eals statments */
int ot = 0; /*mathmatical calculation with in the if eals than statments*/
int othol = 0;
int check = 0; /*total amount of pay for the week*/
printf ("What is your Name?");
scanf ("%s", name);
printf ("Good Day to you %s.");
printf("Please chose one of the following choses so we know the amount of your hourly pay.\n");
printf ("1 : $10.00 an hour.");
printf ("2 : $20.00 an hour.");
printf ("3 : $30.00 an hour.");
printf ("4 : $50.00 an hour.");
scanf ("%d", pay);
switch (pay) {
case 1:
pay = 10;
break;
case 2:
pay = 20;
break;
case 3:
pay = 30;
break;
case 4:
pay = 50;
break;
default:
pay = 10;
break;
Quote:
this is were I get no propt.. any sugestions :o :mad:
printf ("So How many Hours did you work?");
scanf ("%d", hours);
if (hours <= 40);
{
check = pay * hours;
printf ("Your pay this week will be $",check);
}
if (hours > 40);
{
printf ("How many Holiday and Sunday Hours did you have? IF any!");
scanf ("%d", hlhrs);
printf ("How many Overtime hours did you work? If any!");
scanf ("%d", ot);
}// end if eals
check = ((hlhrs * 2) + (ot * 1.5)+ (hours - (hlhrs + ot)));
printf("Your pay this week will be $",check);
}