GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaScript_docs/06.class/7.Quiz2._salaryCalculate.js at main · dev-language/JavaScript_docs

Expand file tree

/

7.Quiz2._salaryCalculate.js

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
36 lines (32 loc) · 1.18 KB
/

7.Quiz2._salaryCalculate.js

Copy path

File metadata and controls

36 lines (32 loc) · 1.18 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
// 정직원과 파트타임 직원을 나타낼 수 있는 클래스를 만들어야 한다.
// 직원 정보 : 이름, 부서이름, 한달 근무시간
// 매달 직원의 정보를 이용해 한달 월급을 계산해야 한다.
// 정직원 시간당 10,000
// 파트타임 직원 시간당 8,000
class Employee {
constructor(name, department, hoursPerMonth, payRate) {
this.name = name;
this.department = department;
this.hoursPerMonth = hoursPerMonth;
this.payRate = payRate;
}
totalSalary() {
return this.hoursPerMonth * this.payRate;
}
}
class FulltimeEmployee extends Employee {
static PAY_RATE = 10000;
constructor(name, department, hoursPerMonth) {
super(name, department, hoursPerMonth, FulltimeEmployee.PAY_RATE);
}
}
class ParttimeEmployee extends Employee {
static PAY_RATE = 8000;
constructor(name, department, hoursPerMonth) {
super(name, department, hoursPerMonth, ParttimeEmployee.PAY_RATE);
}
}
const seogun = new FulltimeEmployee('서근', '총무과', 30);
const mijin = new ParttimeEmployee('미진', '회계과', 20);
console.log(seogun.totalSalary());
console.log(mijin.totalSalary());
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.