switch(employee_worker)
{
case 1:
System.out.print(Enter manager hours:");
manager=input.nextInt();
System.out.print(Enter manager wage:");
wage=input.nextInt();
salary=hours*wage;
System.out.printf("The weekly salary of the manager is %d\n",salary);
break;
case 2: System.out.print("Hourly worker hours:");
hourly_worker=input.nextInt();
System.out.print(Hourly worker wage:");
wage=input.nextInt();
if(hourly_worker>40)
hourly_worker*overtime;
break;
case 3:
}
I'm writing a payroll program and i wasn't sure if i was using the switch statement correctly. this all i wrote so far for the switch statement. i got 2 more cases to put up for the switch to be complete. case three is givin me problems i suppose to put commission workers and how the commions worker receive $250 plus 5.7 percent for gross pay i'm stuck on how to write it in the switch bracket
edit: added [code] tags ~ jayman9

New Topic/Question
Reply




MultiQuote





|