forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestEmployee3.java
More file actions
37 lines (36 loc) · 1.28 KB
/
Copy pathTestEmployee3.java
File metadata and controls
37 lines (36 loc) · 1.28 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
/*
* 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:U16/FNS/CSC/2087;
//NAME:Abdullahi idris;
package TestEmployee3;
import java.util.Scanner;
public class TestEmployee3
{
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();
Employee3 emp1 = new Employee3(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();
Employee3 emp2 = new Employee3(number, name);
emp2.setSalary(emp1.getSalary());
emp1.deductions(50);
emp2.deductions(60, 40);
System.out.println(emp1);
System.out.println(emp2);
}
}