Answer:
// Program is implemented using Java Programming Language
// Comments are used for explanatory purpose
// The program starts here
import java.util.Scanner;
public class CalcRate
{
public static void main (String [] args)
{
//Call scanner function
Scanner input = new Scanner(System.in);
//Variable Declaration
int hour;
double regpay, overtime, total, hourlyrate;
string name,shift;
// Input employee details
System.out.print("What's your name: ");
name = input.nextLine();
System.out.print("What's your Shift: ");
shift = input.nextLine();
System.out.print("Numbers of hours worked: ");
hour = input.nextInt();
System.out.print("What's your hourly pay rate: ");
hourlyrate = input.next.Double();
// Calculate worker's pay
if(hour<=40)
{
regpay = hourlyrate * hour;
overtime = 0;
}
else
{
overtime = (hour - 40) * 1.5 * hourlyrate;
regpay = 40 * hourlyrate;
}
total = regpay + overtime;
// Print payment details
System.out.println(" Employee name: "+name);
System.out.println(" Regular Pay: "+regpay);
System.out.println(" Overtime Pay: "+overtime);
System.out.println(" Total Pay: "+total);
// Print shift output
if(shift == "Day)
{
System.out.println(" Friday day period: ");
}
else
{
System.out.println(" Saturday day period: ");
}
}
}