// Steve Giovenco
// 6/25/03
// This program takes input about the salary of an employee (pay rate, overtime rate, etc.) and computes
// the employee's weekly pay.

import java.io.*;

public class PayCalc
{
	public static void main (String[] args) throws IOException
	{
		//declare our input stream
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		//name prompt
		System.out.print("Enter the employee's name: ");
		String name = in.readLine();
		
		//pay rate prompt
		System.out.print("Enter the employee's pay rate ($/hr): ");
		double payRate = Double.valueOf(in.readLine()).doubleValue();
		
		//overtime rate prompt
		System.out.print("Enter the employee's overtime rate (eg. Enter 1.5 for time and a half): ");
		double OTRate = Double.valueOf(in.readLine()).doubleValue();
		
		//full week hours prompt
		System.out.print("Enter the employee's standard workweek (hrs): ");
		int stdHrs = Integer.parseInt(in.readLine());
		
		//this week hours prompt
		System.out.print("Enter the number of hours the employee worked: ");
		double hrs = Integer.parseInt(in.readLine());
		
		//calculations for base pay
		double dollars = hrs * payRate;
		
		//add on overtime pay
		if (hrs > stdHrs) dollars += (hrs-stdHrs) * payRate *(OTRate - 1);
		
		//output answer
		System.out.println(name + " gets paid $" + dollars + " this week.");
	}
}
