2023 C2 Prelim P1 Commented Sol
Uploaded by user7295 · 14 October 2023
Preview
HWA CHONG INSTITUTION C2 PRELIMINARY EXAMINATION 2023 COMPUTING Higher 2 Mark Scheme 13 Sept 2023 Paper 1 (9569 / 01) 1400 -- 1700 hrs 1. The examinations department of a school needs to store data on the examinations taken by its students. Examination subjects are classified as one of the two types, namely academic subjects and practical subjects. For all subjects, the data that will be stored include: ● Subject code ● Subject name ● Subject type The assessment process for an academic subject comprises two written papers. The duration of each of these two papers will be stored. For the practical subject’s assessment process there are no written papers but there is a single practical examination. A practical examination has a duration and a final date. (a) Draw a diagram that shows suitable classes and their relationships for a solution to this problem that uses OOP techniques. Include appropriate attributes and methods in each class. [6] (b) The school also offers vocational subjects to their students. A vocational subject has no formal examinations, but the assessment is based on the work that the students complete throughout the course. However, this coursework has to be completed by a certain date. Suggest any changes that need to be made to the classes used in part (a). [3] (c) Explain the difference between a class and an object. [2] (d) Give two benefits of Object-Oriented programming. [2]
Solution: (a) SUBJECT - SubjectCode - SubjectName - SubjectType + SetSubjectCode() + SetSubjectName() + SetSubjectType() + GetSubjectCode() + GetSubjectName() + GetSubjectType() ACADEMIC PRACTICAL - Paper1Len - Paper2Len - PracLen - FinalDate + SetPape1Len() + SetPaper2Len() + GetPaper1Len() + GetPaper2Len() + SetPracLen() + SetFinalDate() + GetPracLen() + GetFinalDate() Superclass (Subject) and two subclasses (Academic, Practical) Inheritance from Subject superclass (arrows point upward) Attributes and methods for Subject class Attributes and methods for Academic class Attributes and methods for Practical class Private attributes (minus sign) and public methods (+ sign) (b) Define a new class: Vocational Inherits from Subject class Attribute: CompletionDate Methods: getting and setting CompletionDate (c) Class: ● User defined data type ● Used as a blueprint to create individual objects that have common attributes and methods Object: ● Is an instance of a class
● Each object has unique values to the properties defined
Content continues in the PDF.
Related notes
- VJC Chapter 21 SQLite with PythonNotes/Practices · 2025
- VJC Chapter 23 Web Applications PrinciplesNotes/Practices · 2025
- VJC Chapter 10 RecursionNotes/Practices · 2025
- VJC Chapter 20 SQLNotes/Practices · 2025
- VJC Chapter 16 Hash TableNotes/Practices · 2025
- VJC Chapter 22 NoSQLNotes/Practices · 2025

