-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmplo.java
More file actions
94 lines (77 loc) · 2.13 KB
/
Emplo.java
File metadata and controls
94 lines (77 loc) · 2.13 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import java.util.Scanner;
class employee{
String fn;
String ln;
float Msalary;
void employee(){
fn="";
ln="";
Msalary=0.0f;
}
void getinfo(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter First name:");
fn=sc.nextLine();
System.out.println("enter Last name:");
ln=sc.nextLine();
System.out.println("ENter monthly salary:");
Msalary=sc.nextFloat();
}
void setinfo(){
System.out.println("First name:" +fn);
System.out.println("Last name:"+ln);
System.out.println("Monthly salary:"+ Msalary);
}
void yearlySalary(){
System.out.println("Yearly salary of "+fn+" "+ln+" is"+(12*Msalary));
}
void raisedSalary(){
System.out.println("Yearly Salary after 10% raise :"+(Msalary*1.1)*12);
System.out.println("");
System.out.println("");
}
}
class EmployeeTest{
String fn;
String ln;
float Msalary;
void EmpTest(){
fn="abc";
ln="xyz";
Msalary=0.0f;
}
void getinfo(){
Scanner sc = new Scanner(System.in);
System.out.println("Enter First name:");
fn=sc.nextLine();
System.out.println("enter Last name:");
ln=sc.nextLine();
System.out.println("ENter monthly salary:");
Msalary=sc.nextFloat();
}
void setinfo(){
System.out.println("First name:" +fn);
System.out.println("Last name:"+ln);
System.out.println("Monthly salary:"+ Msalary);
}
void yearlySalary(){
System.out.println("Yearly salary of "+fn+" "+ln+" is"+(12*Msalary));
}
void raisedSalary(){
System.out.println("Yearly Salary after 10% raise :"+(Msalary*1.1)*12);
}
}
class Emplo{
public static void main(String args[]){
employee emp = new employee();
EmployeeTest empTest = new EmployeeTest();
emp.getinfo();
emp.setinfo();
emp.yearlySalary();
emp.raisedSalary();
empTest.getinfo();
empTest.setinfo();
empTest.yearlySalary();
empTest.raisedSalary();
}
}