Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- private static Company company = new Company("ML2");
- public static Scanner scanner = new Scanner (System.in);
- public static void main(String[] args) {
- addNewEmployee();
- }
- public static void addNewEmployee(){
- System.out.println("Please enter employee name: ");
- String employeeName = scanner.nextLine();
- System.out.println("Please enter employee title: ");
- String employeeTitle = scanner.nextLine();
- System.out.println("Please enter employee salary: ");
- double salary = scanner.nextDouble();
- Employee newEmployee = Employee.addEmployee(employeeName,employeeTitle,salary);
- if (company.addNewEmployee(newEmployee)){
- System.out.println("Employee name: " + employeeName + "\n" + "Employee title: "
- + employeeTitle + "\n"+ "employee salary: " + salary ) ;
- }else {
- System.out.println("Employee details are already on file. ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement