Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package employee;
- import java.util.*;
- /**
- *
- * @author Ian
- */
- public class EmployeeClass {
- public static void main(String args[]) {
- Scanner Scan = new Scanner(System.in);
- Employee E1 = new Employee();
- E1.getName();
- System.out.print("Press F for Full-Time or P for Part-Time P: ");
- String Choice = Scan.nextLine();
- if (Choice.equals("F")){
- FullTimeEmployee F1 = new FullTimeEmployee();
- System.out.println(" ");
- F1.setMonthlySalary();
- System.out.println("Name: "+E1.name);
- System.out.println("Monthly Salary: "+String.format("%.2f", F1.monthlySalary));
- return;
- }
- if (Choice.equals("P")){
- PartTimeEmployee P1 = new PartTimeEmployee();
- System.out.println(" ");
- System.out.print("Enter rate per hour and number of hours worked separated by spaces: ");
- P1.setWage();
- System.out.println("Name: "+E1.name);
- System.out.println("Wage: "+ String.format("%.2f", P1.wage));
- }
- else {System.out.println("The letter is invalid");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement