-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarketer.java
65 lines (54 loc) · 1.26 KB
/
marketer.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
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
/*
Input -> 1
Output -> 5000
CodeQuotient - Get better at coding
*/
class Employee {
public int getHours() {
return baseHours; // 40 hours/week
}
public int getSalary() {
return baseSalary; // 50,000
}
public int getVacationDays() {
return baseVacationDays; // 10 days
}
public String getVacationForm() {
return baseVacationForm; // yellow
}
private int baseHours = 40;
private int baseSalary = 50000;
private int baseVacationDays = 10;
private String baseVacationForm = "yellow";
public final void setBaseHours(int hours) {
baseHours = hours;
}
public final void setBaseSalary(int salary) {
baseSalary = salary;
}
public final void setBaseVacationDays(int days) {
baseVacationDays = days;
}
public final void setBaseVacationForm(String form) {
baseVacationForm = form;
}
}
class Marketers extends Employee
{
int salary=5000;
public int getSalary() {
return salary; // 50,000
}
void message()
{
System.out.println("CodeQuotient - Get better at coding");
}
}
class Main{
public static void main(String[] args)
{
Marketers m1=new Marketers();
System.out.println(m1.getSalary());
m1.message();
}
}