-
Notifications
You must be signed in to change notification settings - Fork 701
Expand file tree
/
Copy pathEmployee.java
More file actions
53 lines (34 loc) · 1.57 KB
/
Employee.java
File metadata and controls
53 lines (34 loc) · 1.57 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
package _01_02e;
public class Employee {
public static void main(String[] args) {
// Create a variable called age of type int and assign it the value 29.
int age = 29;
// Print the age variable to the console.
System.out.println(age);
// Create a variable called isAManager of type boolean and assign it the value
// true.
// Print the isAManager variable to the console.
// Create a variable called yearsOfService of type double and assign it the
// value 2.5.
double yearsOfService = 2.5;
// Print the yearsOfService variable to the console.
System.out.println(yearsOfService);
// Create a variable called baseSalary of type int and assign it the value 3000.
int baseSalary = 3000;
// Create a variable called overtimePayment of type int and assign it the value
// 40.
int overtimePayment = 40;
// Create a variable called totalPayment of type int and assign it to the value
// of baseSalary added to overtimePayment.
int totalPayment = baseSalary + overtimePayment;
// Print the totalPayment variable to the console.
System.out.println(totalPayment);
// Create three variables all of type double on a single line.
// They should be called firstBonus, secondBonus and thirdBonus and they should
// be assigned the values 10.00, 22.00 and 35.00.
double firstBonus = 10.00, secondBonus = 22.00 , thirdBonus = 35.00;
// Print out the sum of the variables called firstBonus, secondBonus and
// thirdBonus.
System.out.println(firstBonus + secondBonus + thirdBonus);
}
}