forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestEmployee1.java
More file actions
38 lines (36 loc) · 1.27 KB
/
Copy pathTestEmployee1.java
File metadata and controls
38 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//MATRIC NUMBER:U15/FNS/CSC/2087;
//NAME:Abdullahi idris;
package TestEmployee1;
import java.util.Scanner;
public class TestEmployee1
{
public static void main(String[ ] args) {
Scanner input = new Scanner(System. in);
int number;
String name;
double salary;
System.out.print("Enter Name for Employee 1: ");
name = input.nextLine();
System.out.print("Enter ID Number for Employee 1: ");
number = input.nextInt();
System.out.print("Enter Salary for Employee 1: ");
salary = input.nextDouble();
Employee1 emp1 = new Employee1(number, name, salary);
input.nextLine();
System.out.print("\nEnter Name for Employee 2: ");
name = input.nextLine();
System.out.print("Enter ID Number for Employee 2: ");
number = input.nextInt();
Employee1 emp2 = new Employee1(number, name);
emp2.setSalary(emp1.getSalary());
emp1.deductions(50);
emp2.deductions(60, 40);
emp1.printDetails();
emp2.printDetails();
}
}