-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
31 lines (28 loc) · 923 Bytes
/
Main.java
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
package stia1123_test2;
import java.util.Scanner;
/**
*
* @author Amirul Luqman
*/
public class Main {
public static void main(String[] args){
String name, id, incomeType;
double amount, tax;
Scanner sc = new Scanner (System.in);
System.out.print("Enter staff name: ");
name = sc.nextLine();
System.out.print("Enter staff ID: ");
id = sc.nextLine();
System.out.print("Enter income type: ");
incomeType = sc.nextLine();
System.out.print("Enter income amount: ");
amount = sc.nextDouble();
System.out.print("Enter tax percentage: ");
tax = sc.nextDouble();
System.out.println("");
Income x = new Income(incomeType, amount, tax);
Staff y = new Staff(name, id, x);
y.displayStaffInfo();
y.displayIncomeInfo();
}
}