Let’s put your knowledge of classes to the test by creating a digital school catalog for the New York City Department of Education. The Department of Education wants the catalog to hold quick reference material for each school in the city.
(뉴욕을 위한 디지털 학교 목록을 만들어냄으로써, 수업에 대한 지식을 시험해보자)
(교육부는 카탈로그가 도시의 각 학교에 대한 빠른 참조 자료를 보유하기를 원한다.)
We need to create classes for primary, middle, and high schools. Because these classes share properties and methods, each will inherit from a parent School class. Our parent and three child classes have the following properties, getters, setters, and methods:
(초등학교, 중학교, 고등학교를 위한 수업을 만들어야한다. 이러한 클래스는 속성과 메서드를 공유하기 때문에, School 클래스에서 상속된다.)
(부모 클래스와 초등학교, 중학교, 고등학교 에는 다음과 같은 프로퍼티, getter, setter, methods 가 있다.)
name (string), level (one of three strings: 'primary', 'middle', or 'high'), and numberOfStudents (number)numberOfStudents property has a setter.quickFacts() and .pickSubstituteTeacher() (this is a static method)School class, plus one additional propertypickupPolicy (string)School class, plus one additional propertysportsTeams (array of strings)