Hello is there is any one out there that can help me i just been given this exercise to do and i have done most of it i just need help on alittle bit... The bit i need help on is adding the over time. the Question is is the hours worked has exceeded 40 then the hourly rate must be 1.5 times the normal rate.
If there is anyone that can add this overtime bit in will be greatly appreaciated.
here are the codes that i have done and that are working. This is done in TEXTPAD.
//Rosie Joseph
//J200522635
//This program allows the Employee Name,
// Hours Worked, Hourly Rate and Gross pay be displayed and calculated.
import javax.swing.JOp tionPane;
public class CalcPay
{
public static void main (String args [])
{
String Name;
String Hworked;
String HRate;
String output;
int Hours_Worked;
int Rate;
int GrossPay;
Name = JOptionPane.sho wInputDialog("E nter Your Name:");
Hworked = JOptionPane.sho wInputDialog("E nter Hours worked in week:");
HRate = JOptionPane.sho wInputDialog("E nter the hourly Rate:");
Hours_Worked = Integer.parseIn t(Hworked);
Rate = Integer.parseIn t(HRate);
GrossPay =Hours_Worked * Rate ;
output = "Employee Name: " + Name +
"\nHours Worked in a week: " + Hworked + " hrs "+
"\nHourly Rate : $" + HRate +
"\nThe Gross Pay in a week is $ : " + GrossPay ;
JOptionPane.sho wMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INF ORMATION_MESSAG E);
System.exit(0);
}
}
HELP ME LOL
If there is anyone that can add this overtime bit in will be greatly appreaciated.
here are the codes that i have done and that are working. This is done in TEXTPAD.
//Rosie Joseph
//J200522635
//This program allows the Employee Name,
// Hours Worked, Hourly Rate and Gross pay be displayed and calculated.
import javax.swing.JOp tionPane;
public class CalcPay
{
public static void main (String args [])
{
String Name;
String Hworked;
String HRate;
String output;
int Hours_Worked;
int Rate;
int GrossPay;
Name = JOptionPane.sho wInputDialog("E nter Your Name:");
Hworked = JOptionPane.sho wInputDialog("E nter Hours worked in week:");
HRate = JOptionPane.sho wInputDialog("E nter the hourly Rate:");
Hours_Worked = Integer.parseIn t(Hworked);
Rate = Integer.parseIn t(HRate);
GrossPay =Hours_Worked * Rate ;
output = "Employee Name: " + Name +
"\nHours Worked in a week: " + Hworked + " hrs "+
"\nHourly Rate : $" + HRate +
"\nThe Gross Pay in a week is $ : " + GrossPay ;
JOptionPane.sho wMessageDialog(
null, output , "Calculate pay for the week ",
JOptionPane.INF ORMATION_MESSAG E);
System.exit(0);
}
}
HELP ME LOL
Comment