Part 1 Create a Course class. The Course class in PHP has the following data fields: - course name (private) - capacity (private) - instructor name (private) - number of courses created (private static) 1) Create getters and setters for all personal data fields 2) Create a getter for the static data field 3) Create a constructor that sets up all the course information and has an instructor named 'Dr. Yulia Kumar' by default. Every time a new course is created the number of courses created is incremented by 1. 4) Create a method printCourseInfo() that will output the course information in the clear and easy readable form. 5) Create two courses of your choice (Biology, Chemistry, etc.), print their information using printCourseInfo(). Display the number of courses created using getter for the static data field. Part 2 Create an OnlineCourse class - a child of Course. The OnlineCourse has a single personal data field: the total number of points (private). 1) create getters and setters for the data field. 3) create a constructor that sets up all parent and child information at once. 4) Override the method printCourseInfo() so it outputs the OnlineCourse information in the clear and easy readable form 5) Create two Online Courses of your choice in the same file where parent Courses were created. Verify that the total number of created courses is 4
QUESTION 4
-
Part 1 Create a Course class.
The Course class in PHP has the following data fields:
- course name (private)
- capacity (private)
- instructor name (private)
- number of courses created (private static)
1) Create getters and setters for all personal data fields
2) Create a getter for the static data field
3) Create a constructor that sets up all the course information and has an instructor named 'Dr. Yulia Kumar' by default. Every time a new course is created the number of courses created is incremented by 1.
4) Create a method printCourseInfo() that will output the course information in the clear and easy readable form.
5) Create two courses of your choice (Biology, Chemistry, etc.), print their information using printCourseInfo(). Display the number of courses created using getter for the static data field.
Part 2 Create an OnlineCourse class - a child of Course.
The OnlineCourse has a single personal data field: the total number of points (private).
1) create getters and setters for the data field.
3) create a constructor that sets up all parent and child information at once.
4) Override the method printCourseInfo() so it outputs the OnlineCourse information in the clear and easy readable form
5) Create two Online Courses of your choice in the same file where parent Courses were created. Verify that the total number of created courses is 4.
Step by step
Solved in 2 steps