System: You are ChatGPT, a large language model trained by OpenAI.
User: I will send you a body of text, I will then state what you do next.
User: 356Object-oriented programming conceptsSPECIFICATION COVERAGE 3.1.2.1 Programming paradigms3.1.2.3 Object-oriented programming LEARNING OBJECTIVESIn this chapter you will learn: •the key principles and methods of object-oriented programming (OOP) including encapsulation, inheritance, instantiation, polymorphism, abstraction and overriding•that OOP programs are made up of classes and objects •that classes are a blueprint containing properties and methods•that objects are instances of a class containing the same propertiesand me thods of the class•how to create class diagrams. INTRODUCTIONIn Chapter 5 we looked at structure charts as a method of planning and organising programs. This is a top-down approach that breaks programs into modules, which in turn get broken down into subroutines and functions. Object-oriented programming can be thought of as an extension to this structured approach as it is entirely modular.
 The key difference between procedural and object-oriented programming is that in procedural programming, the lines of code and the data the code operates on are stored separately. An object-oriented program puts all the data and the processes that can be carried out on that data together in one place called an object and allows restrictions to be placed on how the data can be manipulated by the code.
 The examples in this chapter are given in Python, but all of the languages offered by AQA for the Paper 1 exam also support object-oriented programming. Object-oriented programming can be described as being organised in a way that reflects the real world. For example, in real-life you may have an object, such as a bank. Inside that object there are various other objects such as customers and financial transactions. Inside each of those objects there are a number of data items and behaviours. For example, there are A level only36 6 Object-oriented programming conceptsdata about customers. These data are handled in a particular way and therefore have to be processed accordingly. For example, one process might be to add new customer data. Another process might be that money withdrawn needs to be deducted from the balance.In object-oriented programming, a banking application would be created to mirror these real-life relationships. So there might be one object for customers and another for transactions. The customer object will then contain customer data and all the processes needed for that data. There are a number of advantages to this approach: ●Programs are written in modules, which means that it is easy to amendprog rams as only the effected module needs editing.
 ●It is also easier to add new functionality to a program by adding a newmodule. ●Most programs are written by teams of programmers so the modulardesign  approach allows groups of programmers to work independentlyon self -contained modules.
 ●Objects can inherit attributes and behaviours making code reusablethroug hout the program.
 ●Changes carried out to data are made within an object rather than inthe pr ogram. This makes it less likely that changes made to code willinadvertently affect the results of another routine, which is a common cause of bugs in software programs.
 ●Libraries can be created enabling code to be reused easily.
 ●EncapsulationThe concept of keeping the data and the code within the same object is calledencapsulation . The code is known as methods , which are the subroutines contained w ithin an object that are designed to perform particular tasks on the data within the object. This is the main concept behind object-orientedlanguages meaning that the objects are self-contained. The implication of thisis that there are far fewer side-effects than with procedural languages. A side-effect is where a subroutine changes the value of a variable which then hasimplications for other parts of the program.In theory this cannot happen in object-oriented programming as the data can only be directly manipulated by the methods contained within theobject. This concept is sometimes called information hiding, which meansthat the data are directly available in the object that actually needs to use it.Code outside of the class can only access data through the defined methods.
 CustomerProperties MethodsNameAddressDate of birth Add new customerEdit customerDelete customerAccount Account numberBalanceCheck balance Add interestFigure 6.1 Classes containing properties and methods Figure 6.1 shows two classes, Customer  and Account , both containing their own properties and methods. KEYWORDS Encapsulation: the concept of putting properties, methods and data in one object. Method: the code or routines contained within a class.KEYWORD Modular design: a method of system design that breaks a whole system down into smaller units, or modules. KEYWORDProperties: the defining features of an object or class in terms of its data.ENCAPSULATION37The two main building blocks of an object-oriented program are classes and objects: ●A class  is a blueprint or master copy that defines a related groupo f th ings. It contains properties, which describe what the data are,and methods, which describe the way in which the data can behave.However, it does not store any data. Classes can be created based onother classes. ●Objects  are created from a class. Every object is defined as an instance ofa cl ass so will have the same properties and methods from the class from which it is built. It will also contain the data on which the methods willbe run.In the banking example: ●A class might be called Account  whic h defines the properties and methods of a bank account.
 ●All accounts have similar properties such as an Acc ount  Number  andCurrentBalance . ●They also have the same methods – they can GetC urrentBalance ,AddInterest  and so on. ●Each individual type of account would be a subclass of the Acco untclass and they would have all the properties and methods of theclass Account  in addition to properties and methods of their own. Subclasses are explained later in the chapter.
 ●For example, two subclasses based on the class Acco unt may beCurrent  and Mortgage . They both share the properties and methods from the Account  class.
 ●Current Account  wi ll have its own specific properties, such asOverdraft  and PaymentMethods,  which are only a feature of current accounts. Similarly Mortgage  will have its own specificproperties, such as EndDate , which are unique to it. ●Objects are created from the class (or subclass) and represent a particularinst ance of that class. For example, an object created from the Currentclass would be one person’s current account and will contain data aboutthat specific account. ●Any number of objects can be created from a class.
 When designing object-oriented programs, you can see how important it is to think carefully about the properties and methods of each object and how these might be organised into classes. Classes are fundamental to the design of object-oriented programs. Therefore they are stored where they can be reused either in the future, or by programmers working on other modules. The definitions of all classes are stored in a class library. The code below shows a class called Account  being created in Python. This is the base class: class Account(): def   init (self, accountNumber, openingDate, currentBalance, interestRate): self.accountNumber = accountNumberself.openingDate = openingDateself.currentBalance = currentBalanceKEYWORDSClass: defines the properties and methods of a group of similar objects.
 Object: a specific instance of a clas s.38 6 Object-oriented programming conceptsself.interestRate = interestRate    def getA ccountNumber(self): return self.accountNumber    def getCurrentBalance(self): return self.currentBalance    def addInterest(self): interest = self.currentBalance * self. interestRateself.currentBalance += interest    def setInterestRate(self, interestRate): self.interestRate = interestRate ●Inheritance  in object-oriented languages acts in a similar way to the biological definition of inheritance. You start out with a set of characteristics and add to what already exists. You can add or change features and abilitiesbut cannot delete them directly.
 Taking the bank account example mentioned earlier you might start witha base class called Account.  This will have properties and methods. For example the properties may be: AccountNumber: StringDateOpened: DateCurrentBalance: CurrencyInterestRate: RealWhen programmed, the properties become variables with an appropriatedata type assigned. The methods may include: AddInterestGetCurrentBalanceGetInterestRateWhen programmed the methods become the subroutines (procedures orfunctions) required. In this case a procedure or function would be definedto calculate the amount of interest to add to the account. The properties and methods defined in the base class are common to alltypes of account. For example, whether the account was a current accountor mortgage account it would still have the same properties and methods.In addition, the other account types would have additional properties andmethods so these can now be set up as subclasses along with any propertiesand methods that are unique to the subclass. For example, the current account might have a new property Overdraft ,which indicates whether the customer has an overdraft set up on their account. This is unique to current accounts so would not appear as aKEYWORDInheritance: the concept that properties and methods in one class can be shared with a subclass.INHERITANCE 39property on the mortgage account. A method to set the overdraft called setOverdraft  could be defined in the subclass. The mortgage account might have a property called EndDate , which is the date that the mortgage is paid off. This is not a property that you would use in a current account so needs to be set up in the Mortgage subclass. A method may be set up called GetEndDate  to identify the date that the last payment needs to be made. This relationship between the classes and subclasses can be shown as an inheritance diagram as in Figure 6.2. Note that the direction of arrows shows the path of inheritance. Inheritance produces a hierarchical structure. In this scenario, Account  could be described as a base class, super class or parent class, as it is the main class from which other classes Current  and Mortgage  are created. Classes that inherit from others are called subclasses, derived classes or child classes. This example has been simplified to include just two types of account, but the same principle can now be used to define further subclasses. For example, subclasses could be defined for savings accounts, trust fund accounts and so on. class Current(Account): def   init  (self, accountNumber, openingDate, currentBalance, interestRate, paymentType, overdraft): Account.   init  (self, accountNumber, openingDate, currentBalance, interestRate) self.paymentType = paymentTypeself.overdraft = overdraft    def setPaymentType(self, paymentType): self.paymentType = paymentType    def setOverdraft(self, overdraft): self.overdraft = overdraft    def getOverdraft(self): return self.overdraft class Mortgage(Account): def  init  (self, accountNumber, openingDate,  currentBalance, interestRate, endDate): Account.   init  (self, accountNumber, openingDate, currentBalance, interestRate) self.endDate = endDate    def getEndDate(self): return self.endDate    def setEndDate(self, endDate): self.endDate = endDateFigure 6.2 An inheritance diagram for AccountAccount Current Mortgage40 6 Object-oriented programming concepts●Class diagrams for inheritanceClass diagrams  are a standard method for representing classes, their properties and methods and the relationship between the classes. There are different ways of representing the relationships between the classes. This section deals with inheritance: ●They are hierarchical in structure with the base class at the top and thesub classes shown beneath.●A subclass inherits the properties and methods of the base class.
 ●They use arrows to shows the direction of inheritance. ●Each class is represented with a box made up of three sections to includethe cl ass name, properties and methods.
 NameProperties Base class or SuperclassSubclassesMethods NameProperties MethodsNameProperties MethodsFigure 6.3 A basic class diagramA class diagram for the account example might look like this: Base class or Superclass SubclassesOr Derived ClassesCurrent– PaymentType: String – Overdraft: Boolean+ setPaymentType + setOverdraft+ getOverdraftMortgage– EndDate: Date + getEndDate+ setEndDate– AccountNumber: String– OpeningDate: Date– CurrentBalance: Currency– InterestRate: Real + getAccountNumber+ getCurrentBalance+ addInterest+ setInterestRateAccount Figure 6.4 A class diagram for Accou ntKEYWORD Class diagrams: a way of repr esenting the relationship between classes.41POLYMORPHISM AND OVERRIDINGThe class diagram: ●Uses a + or – to indicate the visibility of the properties and methods tother cla sses. + means that the properties and methods are public to allclasses. – means that the properties and methods are private and can only be used in that class.
 ●Uses a # to indicate that the properties and methods are protected so theycan be used in that class and any of its subclasses. ●Uses arrows with the arrow pointing to the base class to show where thesub class is inheriting its properties and methods from. ●Defines the data types to be used for each variable.
 ●Instantiation  is the process of creating an object from a class. In other words, you are creating an actual instance of an object using the properties and methods described in the class. With the Account  example, an objectcould be created from the class Account , which is a specific customer’s current account. Many different objects can be created from the same classso the programmer will need to go through the process of instantiation forevery object needed in the program.
 When programming, there is a subroutine called a constructor, which iscalled when an object is instantiated from a class to initialise the object. new_account = Account(41344987, date.today(),  374.34,0.032) ●Polymorphism and overridingThe literal meaning of polymorphism  is to take on many shapes. In object-oriented programming it describes a situation where a method inherited from a base class can be redefined and used in different waysdepending on the data in the subclass that inherited it.It is related to the hierarchy of classes and the way in which classes inherit properties from other classes. For example, there may be a commonmethod that you want to carry out as part of your program. As this methodis critical to the program, it could be defined in a base class, which is theninherited by other classes. However, the data contained in these new classesis perhaps of a different type. Rather than have to define a new method,polymorphism enables the original method to be redefined so that it willwork with the new data. For example, we could define a method that worked out the interestpayment on an account. This method would be stored in the base classAccount . It would then be inherited by the Current  and Mortgage subclasses. The data needed to calculate interest might be different, forexample, a current account may have a higher rate of interest, or use adifferent time period over which to calculate the payment. Each subclasswould define a different method to calculate the interest, but these wouldhave the same name as the calculate interest method in the base class.KEYWORDInstantiation: the process of creating an object from a class.
 KEYWORD Polymorphism: the ability of different types of data to be manipulated with the same method.42 6 Object-oriented programming conceptsWhen the subclass implements the method it is called overriding  because it over rides (or replaces) the method in the base class. In this example, the method for calculating interest is overridden for the Current  object: #  new method added to the Current class overriding the addInterest method in the Account class    def addInterest(self): #  if the account has an overdraft, interest is charged on the debt at 5%if self.overdraft: charges = self.currentBalance * 0.05 self.currentBalance += charges  #  otherwise interest is applied in the same way as the superclass (Account) else: Account.addInterest( self)●Abstract, virtual and static methods Object-oriented languages handle objects in three different ways. Youcan think of the code inside an object as subroutines, which are a seriesof instructions that it will carry out on the data. Due to the nature of therelationships between objects and classes, it means that methods in oneobject may be used on data contained within another object.In order to define the behaviour of the methods, they can be set up in three different ways: ●Static: the method can be used without an object of the class beinginst antiated.
 ●Virtual: the method is defined in the base class but can be overriddenby the me thod in the subclass where it will be used. This is a feature ofpolymorphism. ●Abstract: the actual method is not supplied in the base class, whichmeans that it must be provided in the subclass. In this case, the object is being used as an interface between the method and the data. Which one you use depends on the nature of the methods and the data contained within the class and at what point you want the method to run.
 ●Aggregation is a method of creating new objects that contain existingobjects, based on the way in which objects are related. Object-orientedprogramming is concerned with recreating real-life objects as programmingobjects. In real life, objects are related to each other. For example, in abusiness you might have an object called Workforce  and another called Job Roles . Under Workforce  there may be further objects calledManager  and Employee . All of these objects exist in their own right, but there is also relationship between them. For example: KEYWORDOverriding: where a method described in the subclass takes precedence over a method with the same name in the base class.DESIGN PRINCIPLES 43●Managers and employees make up the workforce.
 ●Job roles can be taken on by managers or employees.
 ●Job roles define what the managers and employees do as part of theworkf orce.
 Composition aggregationWorkforce  is made up of Manager  and Employee . If you deleted Workforce  you would by definition be deleting Manager  and Employee . This is an example of composition aggregation , sometimes just called composition and it is where one object is composed (or made up of) two or more existing objects. You could say that Workforce  is instantiated (created) when Manager  and Employee  are combined. This can be shown as a class diagram as follows. Notice the shape of the arrow head, which indicates that Manager  and Employee  cannot exist unless Workforce  does.
 WorkforceManager Employee Figure 6.5 Class diagram showing composition aggregationAssociation aggregation You could now extend the Workforce  object to include a Job   Role   object. There is a relationship between Manager , Employee  and Job  Role  in that the managers and employees all have specific job roles that they carry out. However, if you deleted Job Role , the Manager  and Employee  object would still be retained and still be usable objects as would the Workforce  object. This is due to the nature of the relationship in the real world in that a job role is not fixed and therefore any manager or employee could be given any job role. This is an example of association aggregation  where an object is made up of one or more objects but is not entirelydependent on those objects for its own existence. This can be shown as a class diagram as follows. Notice the shape of the arrow head, which indicates that Manager  and Employee  can still exist even if Job Role  does not. Job RoleManager Employee Figure 6.6 Class diagram showing association aggregation●Design principles There are three key design principles that are recognised as producing themost elegant solution when programming using an object-oriented language.
 ●Encapsulate what varies: Th is is related to the concepts of encapsulationand information-hiding and the basic concept is that everything that variesshould be put into its own class. This means that properties and methods aresubdivided into as many classes as needed to reflect the real-life scenario.KEYWORD Composition aggregation: creating an object that contains other objects, and will cease to exist if the containing object is destroyed.
 KEYWORDAssociation aggregation: creating an object that contains  other objects, which can continue to exist even if the containing object is destroyed.44 6 Object-oriented programming conceptsFor example, with our accounts program we could have an Account  base class followed by Current , and Mortgage subclasses and we could stop at that. However, further analysis would suggest that you could create a subclass under Current  for different types of current account such as Standard , Premium , Student  and Child  as these types of account may have properties and methods that are unique to them. You would continue with this process until you were sure that you had created a class for each unique set of properties and methods. ●Favour composition over inheritance: Thi s principle refers to the way inwhich classes and objects are instantiated (created). As we have seen objectscan be created from a base class and inherit its properties and methods. Thealternative is to use aggregation or composition to combine existing objectsto make new ones. This method is less error prone and enables simplermaintenance. For example, with reference to the Workforce  example, rather than creating a new instance for Workforce  we only need to createManager  and Employee  and can then combine the two. Providing Manager  and Employee  are created correctly, then there should beno errors in Workforce . Similarly any changes made to Manager or Employee  will be reflected in Workforce .
 ●Program to interfaces, not implementation: In ob ject-orientedprogramming an interface defines methods to be used, which are thenapplied when classes are defined. In this sense an interface is an abstracttype which is implemented when a class is created. When a class iscreated that adheres to the methods in the interface, it can be seen asan implementation of the interface. With our accounts example, beingable to calculate interest and check the balance were two methods thatall accounts must have regardless of the exact class they are in so thesewould be required by the interface. The way in which these operationsare carried out would be defined within any class that wanted to use theinterface. The interface ensures that they must be defined.Programs can then be written based on the interfaces rather than eachindividual implementation of a class. Using this methodology, if classes needto be added to or amended, this can be done with reference to the interface,meaning there will be little or no impact on the other classes in the program. Practice questions can be found at the end of the section onpages 46  and 47.
  TASKS 1 In what way does object-oriented programming reflect the way things  work in real life? 2 Using a real-life example, define the following terms explaining the  relationship between the three: a)classb)object c)inheritance. 3 Using the same real-life example, explain what properties and  methods are. 4 Draw a class diagram for your real-life example.
  5 How does encapsulation prevent side effects?6 What are the two main ways to instantiate an object?DESIGN PRINCIPLES 45 7 Explain the difference between static, abstract and virtual methods.
  8 Explain the difference between composition aggregation and  association aggregation. 9 What are polymorphism and overriding?10 What is an interface in the context of object-oriented programming? 11 Explain the three main design principles for effective design.
 STUDY / RESEARCH TASKS1 For your real-life example above, use an object-oriented programming language to implement a solution. Include the following features: •objects created using abstract, virtual and static methods•inheritance •aggregation•polymorphism •public, private and protected speciﬁers.
 KEY POINTS•Object-oriented programming can be described as being organised ina way that r eﬂects the real-world. •An object-oriented program puts all the data and the processes(methods) that can be carried out on that data in one place called an object.
 •The concept of keeping the data and the code within the same objectis caled encapsulation. •Class diagrams are a standard method for representing classes, theirproperties and methods and the relationship between the classes. •Inheritance in object-oriented languages acts in a similar way to thebiological definition of inheritance. •Instantiation is the process of creating a real instance of a class,which is an object.
 •Polymorphism describes a situation where a method inherited from abase  class can be used in different ways depending on the data in thesubclass that inherited it. •When the subclass implements the method it is called overridingbecause it overrides (or replaces) the method in the subclass. •Aggregation is a method of creating objects that contain other sorts ofobject.
User: Make the following text more clear.
Format it properly.
Do NOT change the meaning of the words or methods used to obtain the answer or anything like that.
This is for AQA A(S)-Level Computer Science. I repeat, do not alter the words as it could have an effect on the marks acquired from the marking scheme.
However, remove any redundant information or USELESS examples that are not needed for a student to know, or simplify unnecessary information (if it has a definition or keywords, it is not unnecessary).
If you can, use different values for the examples.
For things that will not score a mark or are generally useless, for example, "we will cover" or a fun fact, change the wording.
Link the 'sections' of your answer to the following spec-points (by title):
e.g. "**Topic** (Spec Points: a.b.c. Whatever)
3.1.2.3 Object-oriented programming
None

3.1.2.1 Programming paradigms
None


You MUST make sure they are ALL met. Everything it says on there you should meet.

I already provided the available exam questions you MAY choose to add on to the notes, with 'des' explaining what it's about, and 'fil' meaning the Question ID.
The content, too. Delivered in the form 'fil', JSON
Ignore exam questions that contain 'Skeleton Program'. Do not only put like 2 exam questions, try to put more!
For the exam questions, in the original text, there is a label named 'Tasks'. Those (usually) six questions are NOT the exa questions. The exam questions are the ones that were given in JSON form to you, do NOT do the 'Tasks'. Do the exam questions that contain HTML in JSON!

In the markscheme, a ';' typically means that a mark was gained.
When mentioning exam questions, you *must* answer them, according to the markscheme, scoring full marks. No 'do it yourself'.

If necessary for scoring marks, try to embed the exam-questions into your notes, sometimes without even referencing the fact that it is an exam question. For example, if an exam question is a definition or benefits, use the answer in your notes.
Remember. DO NOT ADD USELESS STUFF. Your task is to create the MOST EFFICIENT (SHORTEST [for an explanation] BUT STILL SCORES ALL MARKS) possible notes resource, which will score all marks easily, so its wording has to be mostly like that of the exam questions. By any means, if necessary, please include examples and exam questions! At the end you can have a 'try these exam questions' thing.
At the end of your answer, you will give a 'breakdown'/'summary' of each thing you covered which will tell the most concise FULLY MARK-SCORING explanation possible.

In summary, your answer must:

* Be efficient, useful
* For topics in an exam that may require some form of mathematical working, always show an example of a question.
* Be clear – provide clear, step-by-step examples/instructions when needed.
* Follow the entire specification and everything it says.
* Link your section to a spec point. E.g. **Topic** (Spec Points: a.b.c Whatever)
* Score ALL marks.
* Include ALL exam questions S at the end (except ones that contain 'Skeleton Program'), with the same wording as the original ones in the JSONs sent to you – and INCLUDE THE QUESTION CONTENT, AND THE ANSWERS/MARK SCHEME. Only the ones that I provided to you, include Question IDs.
* Remove redundant, unnecessary and useless information that would not be brought up in an exam answer.
* Be helpful to the reader
* Include all definitions, do not change the wording (unless that definition is an exam question). Incorporate the definitons into the notes.
* Include a summary at the end that goes through everything you need to score all marks.

At the end of the formatted text, after everything is done, fill out the JSON:
Remove the type clarification.
{
"chapter": (int),
"page": (int),
"chapter_name": (str),
"topics": (list)
}

User: And these are the available exam questions, with 'des' explaining what it's about, and 'fil' meaning the Question ID.
{'L1$.2.c': [{'index1': '|D.A$|K$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|9$|', 'index6': 'Q23L1C08', 'qid': 'Q23L1C08', 'des': 'Virtual method; abstract method; overriding; base class; queue; FIFO', 'index7': '', 'marks': '2 marks', 'time': '3', 'ttext': 'Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q23L1C08', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2023_A-level_resources.html', 'flag1': 0}, {'index1': '|D|D.A$|K$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|5$|', 'index6': 'Q22L1C06', 'qid': 'Q22L1C06', 'des': 'Identify type of relationship in class diagram; public specifier and protected specifier; overriding', 'index7': '', 'marks': '5 marks', 'time': '8', 'ttext': 'Programming | Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q22L1C06', 'year': 2023, 'res': '/RESOURCES/AA_COM/RESOURCES/2022_A-level_resources.html', 'flag1': None}, {'index1': '|D.A$|D.C$|K$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|14$|', 'index6': 'Q21L1C09p1', 'qid': 'Q21L1C09p1', 'des': 'Explain why an attribute could not be a private attribute; OOP; access modifiers', 'index7': '', 'marks': '1 marks', 'time': '2', 'ttext': 'Programming concepts | Practical programming | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q21L1C09P1', 'year': 2021, 'res': '/RESOURCES/AA_COM/RESOURCES/AL_P1_Summer2021.html', 'flag1': 0}, {'index1': '|D|D.A$|K$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|14$|', 'index6': 'Q21L1C09p3', 'qid': 'Q21L1C09p3', 'des': 'What is polymorphism?; OOP', 'index7': '', 'marks': '1 marks', 'time': '2', 'ttext': 'Programming | Programming concepts | Preliminary material', 'fld': 'AA_COM', 'fil': 'Q21L1C09P3', 'year': 2021, 'res': '/RESOURCES/AA_COM/RESOURCES/AL_P1_Summer2021.html', 'flag1': 0}, {'index1': '|D.A$|D.C$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS17309', 'qid': 'QS17309', 'des': 'Class; inheritance; overriding', 'index7': '', 'marks': '9 marks', 'time': '14', 'ttext': 'Programming concepts | Practical programming', 'fld': 'AA_COM', 'fil': 'QS17309', 'year': 2017, 'res': '', 'flag1': 0}, {'index1': '|D.A$|E.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS14308', 'qid': 'QS14308', 'des': 'Discuss components of a GUI', 'index7': '', 'marks': '9 marks', 'time': '14', 'ttext': 'Programming concepts | Classification', 'fld': 'AA_COM', 'fil': 'QS14308', 'year': 2014, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS10311', 'qid': 'QS10311', 'des': 'OO; inheritance; polymorphism', 'index7': '', 'marks': '9 marks', 'time': '14', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS10311', 'year': 2010, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '2$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW08404', 'qid': 'QW08404', 'des': 'OOP programming concepts', 'index7': '', 'marks': '9 marks', 'time': '12', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QW08404', 'year': 2008, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS07407', 'qid': 'QS07407', 'des': 'OOP: aggregation; defining classes', 'index7': '', 'marks': '11 marks', 'time': '15', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS07407', 'year': 2007, 'res': '', 'flag1': 0}, {'index1': '|D.A$|E.D$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW07408', 'qid': 'QW07408', 'des': 'GUI: object-orientation; event-driven', 'index7': '', 'marks': '6 marks', 'time': '8', 'ttext': 'Programming concepts | Operating systems', 'fld': 'AA_COM', 'fil': 'QW07408', 'year': 2007, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW06406', 'qid': 'QW06406', 'des': 'OOP; inheritance diagram; ', 'index7': '', 'marks': '10 marks', 'time': '14', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QW06406', 'year': 2006, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS05407', 'qid': 'QS05407', 'des': 'OOP: inheritance; describing classes for lending library', 'index7': '', 'marks': '8 marks', 'time': '11', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS05407', 'year': 2005, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW05405', 'qid': 'QW05405', 'des': 'OOP; adv; inheritance diagram; ', 'index7': '', 'marks': '8 marks', 'time': '12', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QW05405', 'year': 2005, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS0443A', 'qid': 'QS0443A', 'des': 'Inheritance diagram; class definition', 'index7': '', 'marks': '8 marks', 'time': '11', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS0443A', 'year': 2004, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS03403', 'qid': 'QS03403', 'des': 'OOP: containment; class definition', 'index7': '', 'marks': '3 marks', 'time': '5', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS03403', 'year': 2003, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW03410', 'qid': 'QW03410', 'des': 'OOP; adv; inheritance diagram; ', 'index7': '', 'marks': '8 marks', 'time': '12', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QW03410', 'year': 2003, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS02407', 'qid': 'QS02407', 'des': 'OOP; inheritance diagram; def class; ', 'index7': '', 'marks': '8 marks', 'time': '12', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS02407', 'year': 2002, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QW02401', 'qid': 'QW02401', 'des': 'Inheritance diagram; ', 'index7': '', 'marks': '4 marks', 'time': '6', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QW02401', 'year': 2002, 'res': '', 'flag1': 0}, {'index1': '|D.A$|', 'index2': '|3$|', 'index3': '3$', 'index4': 'L1$.2.c', 'index5': '|', 'index6': 'QS99A305', 'qid': 'QS99A305', 'des': 'OOP; class and inheritance', 'index7': '', 'marks': '5 marks', 'time': '8', 'ttext': 'Programming concepts', 'fld': 'AA_COM', 'fil': 'QS99A305', 'year': 0, 'res': '', 'flag1': 0}], 'L1$.2.a': []}

User: These are the content of said exam questions, these are the ONLY exam questions, you will use these later, delivered in form 'fil', JSON: {'Q23L1C08': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The <b>Skeleton Program</b> uses overriding. When a derived class overrides a method from the base class, the base class method could be either a virtual method or an abstract method.</p>\r\n<p class="indent1new">Describe <b>two</b> differences between a virtual method and an abstract method.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 2 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Marks are for AO1 (understanding)</b></p>\r\n<p class="indent1new">Virtual methods can be overridden by the derived class //</p>\r\n<p class="indent1new m-t-0">virtual methods do not have to be overridden //</p>\r\n<p class="indent1new m-t-0">abstract methods must be overridden by the derived class;</p>\r\n<p class="indent1new">Virtual methods have an implementation/body //</p>\r\n<p class="indent1new m-t-0">virtual methods contain code (with functionality) (in the base class) //</p>\r\n<p class="indent1new m-t-0">abstract methods do not contain an implementation/body //</p>\r\n<p class="indent1new m-t-0">abstract methods contain no code (with functionality) (in the base class) //</p>\r\n<p class="indent1new m-t-0">abstract methods only contain a declaration (in the base class);</p>\r\n<p class="indent1new">Abstract methods can only be declared in abstract classes //</p>\r\n<p class="indent1new m-t-0">virtual methods can be declared in abstract and non-abstract classes;</p>\r\n<p class="indent1new"><b>Max 2</b></p>\r\n<p class="mark">[2]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question asked about the difference between virtual and abstract methods. This topic has not been asked before and very few students were able to demonstrate any understanding of it. Many students either did not attempt this question or gave answers related to abstraction rather than abstract methods.</p>\r\n<p class="indent1new">There were a number of students who got the two types of method the wrong way round and gave answers such as &quot;Virtual methods must be overridden whereas abstract methods can be overridden&quot;.</p></h5>', 'notes': '', 'resources': ''}, 'Q22L1C06': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">An incomplete class diagram of the user-defined classes for part of the Skeleton Program is shown in the diagram below.</p>\r\n<p class="graph"><img src="AA_COM/Q22L1C06_files_Q/img01.jpg"/></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(a)&emsp;&nbsp;State the type of relationship the diagram in the diagram above shows between the class indicated by <img class="vert-middle vert-up-1" src="AA_COM/Q22L1C06_files_Q/img02.jpg"/> and the class indicated by <img class="vert-middle vert-up-1" src="AA_COM/Q22L1C06_files_Q/img03.jpg"/>.</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&emsp;&nbsp;State the identifier of the class indicated by <img class="vert-middle vert-up-1" src="AA_COM/Q22L1C06_files_Q/img04.jpg"/> in the diagram above.</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&emsp;&nbsp;Explain the difference between an attribute that has a public specifier and an attribute that has a protected specifier.</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(d)&emsp;&nbsp;In object-oriented programming, what is meant by overriding?</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(1)</p>\r\n<p class="mark">(Total 5 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="questiona">(a)&emsp;&nbsp;<b>Mark is for AO2 (analyse)</b></p>\r\n<p class="indent2new indentright">Inheritance;</p>\r\n<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&emsp;&nbsp;<b>Mark is for AO2 (analyse)</b></p>\r\n<p class="indent2new indentright"><span class="comp-top">Card;</span></p>\r\n<p class="indent2new indentright"><b>R.</b> if spelt incorrectly</p>\r\n<p class="indent2new indentright m-t-0"><b>R.</b> if any additional code</p>\r\n<p class="indent2new indentright m-t-0"><b>I.</b> case</p>\r\n<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&emsp;&nbsp;<b>Marks are for AO1 (understanding)</b></p>\r\n<p class="indent2new indentright">Public means it can be accessed / seen outside of the class it is in;</p>\r\n<p class="indent2new indentright">Protected means it can be accessed / seen in the class it is in and in any subclasses // protected means it can be accessed / seen in the class it is in and in any classes derived / inheriting from it;</p>\r\n<p class="indent2new indentright"><b>A.</b> Protected means it can be accessed / seen by any class in the same package (and by subclasses in any package) (<b>Java only</b>)</p>\r\n<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(d)&emsp;&nbsp;<b>Mark is for AO1 (knowledge)</b></p>\r\n<p class="indent2new indentright">When a derived class / subclass has a different implementation for a method / function / subroutine to the class it inherits from / from the base class;</p>\r\n<p class="levelms">1</p>\r\n<p class="mark">[5]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question was about object-oriented programming in the skeleton program.</p>\r\n<p class="indent1new">Part (a) was answered correctly by most students. The most common wrong answer was aggregation. Part (b) was also answered well, with <span class="comp">Breakthrough</span> being the most common wrong answer.</p>\r\n<p class="indent1new">For part (c), a significant number of students described the <i>private</i> specifier instead of the <i>protected</i> specifier. Answers showed that more students understood the <i>public</i> specifier than the <i>protected</i> specifier. A common incorrect answer was to talk about the permissions people would have to modify parts of the code.</p>\r\n<p class="indent1new">Answers for part (d) often lacked precision and showed limited understanding of overriding. To gain the mark answers needed to make clear the link to inheritance.</p></h5>', 'notes': '', 'resources': ''}, 'Q21L1C09P1': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question is about the different types of piece in the game.</p>\r\n<p class="indent1new">Explain why the <span class="comp">FuelCostOfMove</span> attribute in the <span class="comp">Piece</span> class could <b>not</b> have been a private attribute.</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO2 (analyse)</b></p>\r\n<p class="indent1new">The classes that inherit from <span class="comp">Piece</span> would not be able to use it;</p>\r\n<p class="indent1new m-t-0"><b>A.</b> answers that use a specific class that would not be able to use it (<span class="comp">Baron, LESS, PBDS</span>).</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '', 'notes': '', 'resources': ''}, 'Q21L1C09P3': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This question is about the different types of piece in the game.</p>\r\n<p class="indent1new">In object-oriented programming, what is meant by polymorphism?</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="indent1new answer-toggle">_______________________________________________________________________</p>\r\n<p class="mark">(Total 1 mark)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question"><b>Mark is for AO1 (understanding)</b></p>\r\n<p class="indent1new">A method shared (up and down the inheritance hierarchy chain) but with each class / method implementing it differently</p>\r\n<p class="indent1new m-t-0">//</p>\r\n<p class="indent1new m-t-0">A single interface is provided to entities/objects of different classes / types</p>\r\n<p class="indent1new m-t-0">//</p>\r\n<p class="indent1new m-t-0">Objects of different classes / types respond differently to the use of a common interface / the same usage</p>\r\n<p class="indent1new m-t-0">//</p>\r\n<p class="indent1new m-t-0">Allowing different classes to be used with the same interface</p>\r\n<p class="indent1new m-t-0">//</p>\r\n<p class="indent1new m-t-0">The ability to process objects differently depending on their class / type;</p>\r\n<p class="mark">[1]</p></h5>', 'examinerreport': '', 'notes': '', 'resources': ''}, 'QS17309': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">An object-oriented program is being written to store details of the hardware devices that are connected to a computer network in a college. This will be used by the network manager to perform an audit of the equipment that they manage.</p>\r\n<p class="indent1new">Two different types of devices are connected to the network. They are printers and computers. The computers are categorised as being laptops, desktops or servers.</p>\r\n<p class="indent1new">A class <b>Device</b> has been created and two subclasses, <b>Printer</b> and <b>Computer</b> are to be developed. The <b>Computer</b> class will have three subclasses: <b>Laptop</b>, <b>Desktop</b> and <b>Server</b>.</p>\r\n<p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draw an inheritance diagram for the six classes.</p>\r\n<p class="indent1 m-t-5 answer-toggle">&nbsp;</p>\r\n<p class="mark">(3)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">The <b>Device</b> class has data fields <b>MACAddress</b>, <b>DeviceName</b> and <b>Location</b>.</p>\r\n<p class="indent1new">The class definition for <b>Device</b> is:</p>\r\n<p class="indent3new comp-top">Device = Class</p>\r\n<p class="indent5new comp">&emsp;Public</p>\r\n<p class="indent5new comp">&emsp;&emsp;Procedure AddDevice</p>\r\n<p class="indent5new comp">&emsp;&emsp;Function GetMACAddress</p>\r\n<p class="indent5new comp">&emsp;&emsp;Function GetDeviceName</p>\r\n<p class="indent5new comp">&emsp;&emsp;Function GetLocation</p>\r\n<p class="indent5new comp">&emsp;Private</p>\r\n<p class="indent5new comp">&emsp;&emsp;MACAddress: String</p>\r\n<p class="indent5new comp">&emsp;&emsp;DeviceName: String</p>\r\n<p class="indent5new comp">&emsp;&emsp;Location: String</p>\r\n<p class="indent4new comp">&emsp;&emsp;End</p>\r\n<p class="indent1new"><span class="comp">AddDevice</span> is the constructor function for the <b>Device</b> class and is called whenever a new <b>Device</b> object is created.</p>\r\n<p class="indent1new">The <b>Computer</b> class has the following additional data fields:</p>\r\n<p class="indent1 m-t-0">&#8226;&emsp;&emsp;&nbsp;<b>ProcessorName</b>: Stores the name of the company that manufactured the processor installed in the computer.</p>\r\n<p class="indent1 m-t-0">&#8226;&emsp;&emsp;&nbsp;<b>RAMCapacity</b>: Stores the capacity of the RAM installed in the computer, in gigabytes, eg 16.</p>\r\n<p class="indent1 m-t-0">&#8226;&emsp;&emsp;&nbsp;<b>HDDCapacity</b>: Stores the capacity of the Hard Disk Drive installed in the computer, in gigabytes, eg 512.</p>\r\n<p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write the class definition for <b>Computer</b>.</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(4)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <b>Laptop</b> class has the additional data field <b>BluetoothInstalled</b>. This field will indicate whether or not the laptop is fitted with a Bluetooth module.</p>\r\n<p class="indent2new">Write the class definition for <b>Laptop</b>.</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="indent2new answer-toggle">___________________________________________________________________</p>\r\n<p class="mark">(2)</p>\r\n<p class="mark">(Total 9 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="questiona indentright">(a)&emsp;&nbsp;</p>\r\n<p class="indent2new indentright m-t-0"><img src="AA_COM/MS17309_files_M/img01.jpg"/></p>\r\n<p class="indent2new indentright m-t-s"><b>1 mark</b> for Device at top of diagram with Printer and Computer directly underneath it and linked to it and no other labels linked to it;</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b> for Computer with Laptop, Desktop and Server directly underneath it and linked to it, and no other labels linked to it (except Device above);</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b> for correctly styled diagram, i.e. lines drawn as arrows and boxes (any shape) around labels; &ndash; <b><i>This mark is only available if candidate has already achieved at least one mark for correct contents of the diagram.</i></b></p>\r\n<p class="indent2new indentright"><b>A</b>. Arrows drawn as:</p>\r\n<p class="indent2new indentright m-t-0"><img src="AA_COM/MS17309_files_M/img02.jpg"/></p>\r\n<p class="indent2new indentright m-t-s"><b>A</b>. Filled/empty arrowheads</p>\r\n<p class="indent2new indentright m-t-0"><b>A</b>. Diagram rotated by 90 degrees</p>\r\n<p class="levelms">3</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&emsp;&nbsp;</p>\r\n<p class="indent2new indentright m-t-0"><img src="AA_COM/MS17309_files_M/img03.jpg"/></p>\r\n<p class="indent2new indentright m-t-s">Accept answers that use different notations, so long as meaning is clear.</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b> for correct header including name of class and parent class;</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b> for redefining the AddDevice (constructor)procedure;</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b>&#42; for defining all 3 extra functions needed to read variable values, all identified as being public (keyword public is optional if functions are declared before variables);</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b><sup class="xsmall">#</sup> for defining all 3 extra variables, with appropriate data types and identified as being private;</p>\r\n<p class="indent2new indentright m-t-0"><b>A</b>. Any sensible numeric types for RAMCapacity and HDDCapacity, do not have to be whole numbers</p>\r\n<p class="indent2new indentright m-t-0"><b>A</b>. Answers that indicate separately that each variable is private or each method is public</p>\r\n<p class="indent2new indentright m-t-0"><b>R</b>. Do not award mark for declaring new functions if any of the functions have the same name as the variables</p>\r\n<p class="indent2new indentright m-t-0"><b>I</b>. Parameters to methods, minor changes to names that do not affect clarity</p>\r\n\r\n<p class="indent2new indentright"><b>&#42;</b>. Do not award this mark if any extra functions/procedures have been declared, except for functions that would set values eg SetProcessorName or an incorrectly named procedure to add eg AddComputer</p>\r\n<p class="indent2new indentright m-t-0"># &ndash; Do not award this mark if any extra variables have been declared</p>\r\n<p class="levelms">4</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&emsp;&nbsp;</p>\r\n<p class="indent2new indentright m-t-0"><img src="AA_COM/MS17309_files_M/img04.jpg"/></p>\r\n<p class="indent2new indentright m-t-s"><b>1 mark</b> for correct header including name of class and parent class;</p>\r\n<p class="indent2new indentright"><b>MAX 1</b> of the following two marks:</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b> for redefining the AddDevice procedure;</p>\r\n<p class="indent2new indentright m-t-0"><b>1 mark</b>&#42; for:</p>\r\n<p class="indent2 indentright m-t-0">&#8226;&emsp;&emsp;&nbsp;defining the GetBluetoothInstalled function needed to read this value, identified as being public (keyword public is optional if function is declared before variable)</p>\r\n<p class="indent2 indentright m-t-0">&#8226;&emsp;&emsp;&nbsp;defining the BluetoothInstalled variable with an appropriate data type as being private.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright m-t-0"><b>A</b>. Boolean or whole number types for BluetoothInstalled but reject string, character or real number types</p>\r\n<p class="indent2new indentright m-t-0"><b>A</b>. Different sensible name for GetBluetoothInstalled function eg CheckBluetoothInstalled, IsBluetoothInstalled</p>\r\n<p class="indent2new indentright m-t-0"><b>A</b>. Answers that indicate separately that each variable is private or each method is public</p>\r\n<p class="indent2new indentright m-t-0"><b>I</b>. Parameters to methods, minor changes to names that do not affect clarity</p>\r\n<p class="indent2new indentright m-t-0"><b>I</b>. Addition of any extra functions or variables</p>\r\n<p class="indent2new indentright">&#42; Do not award this mark if any extra functions / procedures / variables declared, except for a SetBluetoothInstalled procedure.</p>\r\n<p class="levelms">2</p>  \r\n<p class="mark">[9]</p></h5>', 'examinerreport': '', 'notes': '', 'resources': ''}, 'QS14308': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1new m-t-0">An event-driven, object-oriented programming language lets the programmer create a Graphical User Interface (GUI) from components such as forms and buttons. The components of the GUI are implemented using a class hierarchy and inheritance.</span></p>\r<p class="indent1">(a) &nbsp;&nbsp;&nbsp;&nbsp;Explain what is meant by inheritance.</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b) &nbsp;&nbsp;&nbsp;&nbsp;One GUI component is a <b>Selector</b>. Selectors come in two different types: <b>ComboBox</b> and <b>ListBox</b>.</p>\r<p class="bottom">&nbsp;</p>\r<table class=MsoTableGrid cellspacing=0 cellpadding=5 style=\'margin-top:0.0cm; margin-left:60.0pt;border-collapse:collapse;\'> \r\t<tr>\r\t\t<td style=\'width:80.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl><b>Selector Type</b></p></td>\r\t\t<td style=\'width:320.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl><b>Description</b></p></td>\r\t</tr>\r\t<tr>\r\t\t<td valign="top" style=\'width:80.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl>ComboBox</p></td>\r\t\t<td valign="top" style=\'width:320.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl>A combo box lets the user make an input either by typing into<br/>the box <b>or</b> by picking a single item from a list.</p></td>\r\t</tr>\r\t<tr>\r\t\t<td valign="top" style=\'width:80.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl>ListBox</p></td>\r\t\t<td style=\'width:320.0pt;border:solid windowtext 1.0pt;padding:0cm 5.4pt 0cm 5.4pt;\'><p class=boxl>A list box lets the user select options from a list. The user<br/>cannot type into a list box. There are two different types of list<br/>box:<br/><br/>&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;<b>SingleSelectionListBox</b>: The user can only select one<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;item from a list. Whenever an item is selected, the<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;previously selected item is deselected.<br/><br/>&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;<b>MultipleSelectionListBox</b>: The user can select one or<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;more items from a list. Whenever an item is selected, it is<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;added to the list of selected items.</p></td>\r\t</tr>\r</table></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">Draw an inheritance diagram for the classes: Selector, ComboBox, ListBox, <br/>SingleSelectionListBox and MultipleSelectionListBox.</p>\r<p class="indent1new answer-toggle">&nbsp;</p>\r<p class="indent1new answer-toggle">&nbsp;</p>\r<p class="indent1new answer-toggle">&nbsp;</p>\r<p class="indent1new answer-toggle">&nbsp;</p>\r<p class="indent1new answer-toggle">&nbsp;</p>\r<p class="mark">(3)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c) &nbsp;&nbsp;&nbsp;&nbsp;The <b>Selector</b> class has data fields <b>Items</b> and <b>NumberOfItemsInList</b>:</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Items</b>: an array that stores the list of strings that will appear in the selector.</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>NumberOfItemsInList</b>: a number that indicates how many items there are in the selector.</p>\r<p class="indent2new">It also has a procedure that the programmer can call to add an item to the list of strings (<b>AddItemToList</b>) and a procedure that is called by the operating system whenever the user selects an item from the list (<b>SelectItemFromList</b>).</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">The <b>Selector</b> class does not include a procedure to display the items in the list as the way items are displayed is different for each type of selector.</p>\r<p class="indent2new">The class definition for <b>Selector</b> is:</p>\r<p class="indent3new"><span class="comp-top">&nbsp;&nbsp;&nbsp;Selector = Class<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Public<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Procedure AddItemToList<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Procedure SelectItemFromList<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Private<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Items: Array of String<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NumberOfItemsInList: Integer<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">A class is to be created for the <b>ComboBox</b> type of selector.</p>\r<p class="indent2new">The <b>ComboBox</b> class needs the following additional data fields:</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>TextTyped</b>: Stores the characters that have been typed by the user if they have made their input by typing rather than picking an option from the list.</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>SelectedItemNumber</b>: Stores the position in the list of the item that has been selected by the user, if one has been selected.</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>AllowNonListInputs</b>: A True or False value that indicates whether the user should be allowed to type in text that is not one of the items in the list.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">The class will need to implement the operation of selecting an item from the list differently from the way the <b>Selector</b> class implements this operation, but the operation of adding an item to the list will be implemented in the same way by both of these classes.</p>\r<p class="indent2new">The class must provide subroutines to:</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display the combo box</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;respond to the operating system&#x2019;s notification of a key press</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return the text that has been typed in</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return the selected item number</p>\r<p class="indent2 m-t-0">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set the value of <b>AllowNonListInputs</b> flag to True or False, to indicate whether or not the user is allowed to type text that is not in the list.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">Write the class definition for the <b>ComboBox</b> class.</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="mark">(5)</p> \r<p class="mark">(Total 9 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a) &nbsp;&nbsp;&nbsp;&nbsp;A class / subclass has / shares / can access properties and methods of the (parent) class it is derived from;</span></p>\r<p class="indent2new indentright m-t-0">Building a hierarchy of classes with each child class inheriting access to its parent class\' methods and properties;</p>\r<p class="indent2new indentright m-t-0">Relationship between two object (types) in which one object (type) is a kind of the other;</p>\r<p class="indent2 indentright m-t-0"><b>MAX 1</b></p>\r<p class="indent2new indentright"><b>A</b> Just one of properties and methods, do not need both.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> Use of the word "inherits" in the response only if the relationship between parent and subclass is stated explicitly otherwise it is <b>NE</b></p>\r<p class="indent2new indentright m-t-0"><b>A</b> The following as alternatives to properties: fields, attributes, characteristics, data.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> The following as alternatives to methods: procedures, functions, code.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> The following as alternatives to parent: base, super.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> The following as alternative to child: descendent, subclass, derived.</p>\r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b) &nbsp;&nbsp;&nbsp;&nbsp;<br/><img align="middle;" src="AA_COM/MS14308_files_M/img01.png"/>&nbsp;</p>\r<p class="indent2new indentright"><b>1 mark</b> for Selector at top of diagram with ComboBox and ListBox directly underneath it and linked to it and no other labels linked to it;</p>\r<p class="indent2new indentright m-t-0"><b>1 mark</b> for ListBox with SingleSelectionListBox and MultipleSelectionListBox directly underneath it and linked to it, and no other labels linked to it (except Selector above);</p>\r<p class="indent2 indentright m-t-0"><b>MAX 1</b> of the above <b>2 marks</b> if any additional links drawn in</p>\r<p class="indent2new indentright"><b>1 mark</b> for correctly styled diagram, i.e. lines drawn as arrows and boxes (any shape) around labels; - <b><i>This mark is only available if candidate has already achieved at least <b>1 mark</b> for correct contents of the diagram.</i></b></p>\r<p class="indent2new indentright"><b>A</b> arrows drawn as:</p>\r<p class="indent2new indentright m-t-0">&nbsp;&nbsp;&nbsp;<img align="middle;" src="AA_COM/MS14308_files_M/img02.png"/>&nbsp;</p>\r<p class="indent2new indentright m-t-0"><b>A</b> any type of arrowheads.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> diagram rotated through 90 / 180 / 270 degrees.</p>\r<p class="indent2new indentright m-t-0"><b>A</b> arrows draw wrong way round (but cannot get mark for correctly styled diagram).</p>\r<p class="indent2new indentright m-t-0"><b>A</b> class diagrams.</p>\r<p class="levelms">3</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c) &nbsp;&nbsp;&nbsp;&nbsp;<span class="comp">ComboBox = Class (Selector)<br/>&nbsp;&nbsp;Public<br/>&nbsp;&nbsp;&nbsp;&nbsp;Procedure SelectItemFromList<br/>&nbsp;&nbsp;&nbsp;&nbsp;Procedure Display<br/>&nbsp;&nbsp;&nbsp;&nbsp;Procedure KeyPressed<br/>&nbsp;&nbsp;&nbsp;&nbsp;Function&nbsp;&nbsp;GetTextTyped<br/>&nbsp;&nbsp;&nbsp;&nbsp;Function&nbsp;&nbsp;GetSelectedItemNumber<br/>&nbsp;&nbsp;&nbsp;&nbsp;Procedure SetAllowNonListInputs<br/>&nbsp;&nbsp;Private<br/>&nbsp;&nbsp;&nbsp;&nbsp;TextTyped: String<br/>&nbsp;&nbsp;&nbsp;&nbsp;SelectedItemNumber: Integer<br/>&nbsp;&nbsp;&nbsp;&nbsp;AllowNonListInputs: Boolean<br/>End</span></p>\r<p class="indent2new indentright"><b>Accept answers that use different notations, so long as meaning is clear</b>.</p>\r<p class="indent2new indentright m-t-0">Accept any sensible names for subroutines, except</p>\r<p class="indent2new indentright m-t-0">SelectItemFromList which must have this name as it overrides a procedure in the parent class.</p>\r<p class="indent2new indentright"><b>1 mark</b> for correct header including name of class (ComboBox) and parent class (Selector);</p>\r<p class="indent2new indentright m-t-0"><b>1 mark</b> for overriding the SelectItemFromList procedure (it is not necessary to state that overriding is occurring but must be public);</p>\r<p class="indent2new indentright m-t-0"><b>2 marks</b> for defining all 5 other extra functions / procedures needed, all identified as being public (keyword public is optional if they are declared before variables);; <b>OR <b>1 mark</b></b> if at least 2 of them defined;</p>\r<p class="indent2new indentright m-t-0"><b>1 mark</b> for defining all 3 extra variables, with appropriate data types and identified as being private;</p>\r<p class="indent2new indentright"><b>A</b> Array of characters as alternative to string for TextTyped</p>\r<p class="indent2new indentright m-t-0"><b>A</b> Any sensible numeric types for SelectedItemNumber (must be whole numbers)</p>\r<p class="indent2new indentright m-t-0"><b>A</b> Answers that indicate separately that each variable is private or each method is public</p>\r<p class="indent2new indentright m-t-0"><b>A</b> Two procedures instead of one for setting the value of AllowNonListInputs by result, eg, Procedure AllowTextInputs and Procedure OnlyAllowSelection</p>\r<p class="indent2new indentright m-t-0"><b>A</b> Procedure instead of Function and vice-versa</p>\r<p class="indent2new indentright m-t-0"><b>I</b> parameters to methods, minor changes to names that do not affect clarity</p>\r<p class="indent2new indentright m-t-0"><b>R</b> do not award marks for functions / procedures with the same name as variables</p>\r<p class="indent2new indentright m-t-0"><b>DPT</b> if any additional functions / procedures / variables declared do not award the first of the three marks for correctly defining new functions and variables, but award subsequent marks. However, do not penalise answers that include any of the following procedures / functions: <span class="comp">GetAllowNonListInputs, SetTextTyped, SetSelectedItemNumber</span></p>\r<p class="levelms">5</p> \r<p class="mark">[9]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a) &nbsp;&nbsp;&nbsp;&nbsp;This part asked students to explain what inheritance was. Just under two thirds of students were able to do this. Those students who failed to achieve the mark usually did not make clear that the relationship was between a parent class and a sub class or, if they did this correctly, failed to explain the nature of the relationship, ie that the sub class could share some of the methods or properties of the parent.</p>\r<p class="indent1">(b) &nbsp;&nbsp;&nbsp;&nbsp;Students had to draw an inheritance diagram in this part. Almost 90% of candidates achieved at least two of the three available marks, but only half of the candidates achieved full marks. The failure to achieve the third mark was usually because a candidate failed to style the diagram correctly, either not drawing arrowheads, drawing them at the wrong end of the lines, or not enclosing the names of the classes in some type of box.</p>\r<p class="indent1">(c) &nbsp;&nbsp;&nbsp;&nbsp;A very good range of responses was made to this part. The most common mistakes that students made were to fail to identify that the new class was a sub class of the Selector class, to fail to redefine the SelectItemFromList procedure so that it was overridden, to add in extra unnecessary functions and procedures, and to redefine the data items from the parent class.</p></h5>', 'notes': '', 'resources': ''}, 'QS10311': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">An object-oriented program is being written to store details of and play digital media files that are stored on a computer. A class <b>MediaFile</b> has been created and two subclasses, <b>VideoFile</b> and <b>MusicFile</b> are to be developed.</span></p>\r<p class="indent1new">The classes <b>VideoFile</b> and <b>MusicFile</b> are related to MediaFile by single inheritance.</p>\r<p class="indent1">(a) &nbsp;&nbsp;&nbsp;&nbsp;Explain what is meant by <i>inheritance.</i></p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b) &nbsp;&nbsp;&nbsp;&nbsp;Draw an inheritance diagram for the three classes.</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c) &nbsp;&nbsp;&nbsp;&nbsp;One important feature of an object-oriented programming language is the facility to override methods (functions and procedures).</p>\r<p class="indent2new">Explain what is meant by <i>overriding</i> when writing programs that involve inheritance.</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(d) &nbsp;&nbsp;&nbsp;&nbsp;The <b>MediaFile</b> class has data fields <b>Title</b> and <b>Duration</b>.</p>\r<p class="indent2new">The class definition for <b>MediaFile</b> is:</p>\r<p class="indent2new"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MediaFile = Class<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Public<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Procedure PlayFile<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function &nbsp;GetTitle<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function &nbsp;GetDuration<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Private<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Title : String<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Duration : Real<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End</span></p>\r<p class="indent2new">Note that the class does not have procedures to set the values of the variables as these are read automatically from data stored within the actual media file.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">The <b>MusicFile</b> class has the following additional data fields:</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Artist</b>: Stores the name of the band or singer that recorded the music.</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>SampleRate</b>: Stores the rate at which the music has been sampled.</p>\r<p class="indent2">&#x2022;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>BitDepth</b>: Stores the number of bits in which each sampled value is represented.</p>\r<p class="indent2new">Write the class definition for <b>MusicFile</b>.</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="indent2new answer-toggle">___________________________________________________________________</p>\r<p class="mark">(4)</p> \r<p class="mark">(Total 9 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; A class/subclass has/shares/inherits properties and methods with the (parent) class (it is derived from); <br><b>A</b> another class<br/>Building a hierarchy of classes with each child class inheriting access to its parent class\'s methods and properties;<br/>Relationship between two object types/objects in which one object (type) is a kind of the other;</span></p>\r<p class="indent2new indentright m-t-0"><b>A</b> Just one of properties and methods, do not need both.<br/><b>A</b> The following as alternatives to properties: fields, attributes, characteristics, data with data as BOD<br/><b>A</b> The following as alternatives to methods: procedures, functions, code.<br/><b>A</b> The following as alternatives to parent: base, super.<br/><b>A</b> The following as alternative to child: descendent, subclass, derived.</p>\r<p class="levelms">Max 1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b) &nbsp;&nbsp;&nbsp;&nbsp;\r<p class="indent2new indentright m-t-0"><img align="middle;" src="AA_COM/MS10311_files_M/img01.png">&nbsp;</p>\r<p class="indent2new indentright"><i>1 mark for class names in boxes, with MediaFile drawn above the other two;</i></p> \r<p class="indent2new indentright m-t-0"><i>1 mark for correct arrows;</i></p>\r<p class="indent2new indentright"><b>A </b>arrows drawn as:<img align="middle;" src="AA_COM/MS10311_files_M/img02.png">&nbsp;</p>\r<p class="indent2new indentright m-t-0"><b>A</b> filled/empty arrowheads</p>\r<p class="indent2new indentright m-t-0"><b>A</b> rotated through 90 degrees</p>\r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c) &nbsp;&nbsp;&nbsp;&nbsp;Method can be defined with same name; <br><b>A</b> method can be redefined, an inherited method (but not just inheritance) as implying same name<br/>But have different implementation/code // perform different function;<br/>The redefined method will be used instead of the parent&#x2019;s method;<br/><b>A</b> This is an example of polymorphism<br/><b>A</b> Procedure, function, subroutine for method.</p>\r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright" style=\'margin-bottom:0cm\'>(d) &nbsp;&nbsp;&nbsp;&nbsp;<span style=\'font-family:Courier New;font-size:10pt\'>MusicFile = Class/Subclass (MediaFile)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1</p>\r<table class=MsoTableGrid cellspacing=0 cellpadding=0 border=0 style=\'margin-top:0cm;margin-left:80.0pt;border-collapse:collapse\'>\r\t<tr>\r\t\t<td width=400 valign=top><p class=boxl style=\'margin-top:0cm;margin-bottom:0cm\'><span style=\'font-family:Courier New;font-size:10pt\'>\r&nbsp;&nbsp;&nbsp;<u>Public</u><br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Procedure PlayFile (Override)\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function GetArtist<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function GetSampleRate<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Function GetBitDepth<br>\r&nbsp;&nbsp;&nbsp;<u>Private</u><br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Artist : String<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SampleRate : Real 1<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BitDepth : Integer<br>\r&nbsp;&nbsp;&nbsp;End<br>\r</span></span></p></td>\r\t\t<td width=30 valign=top><p class=boxl><br><img height=130 align="middle;" src="AA_COM/MS10311_files_M/brackets2.png"></p></td>\r\t\t<td width=30 valign=top><p class=boxl style=\'margin-top:0cm;margin-bottom:0cm\'><span class="comp"><span class="comp"><br>1<br><br>1<br><br><br>1</p></span></td>\r\t</tr>\r</table>\r<p class="indent2new indentright"><i>1 mark for correct header including name of class and parent class;<br/>1 mark for redefining the PlayFile procedure;<br/>1 mark for defining all 3 extra <u>functions</u> needed to read variable values;<br/>1 mark for defining all 3 extra properties, with appropriate data types in private section;</i><br><br/><b>A</b> any numeric types for SampleRate and BitDepth<br/><b>A</b> answers that indicate separately that each variable is private<br/><b>DPT</b> if any extra functions/procedures/variables included but do not penalise answers that have extra procedures to set variable values.<br/><b>DPT</b> if any of the functions/procedures are private<br/><b>I</b> parameters to methods, minor changes to names that do not affect<br/>clarity, case</p>\r<p class="indent2new indentright">OR</p><br>\r<table class=MsoTableGrid cellspacing=0 cellpadding=0 border=0 style=\'margin-top:0cm;margin-left:50.0pt;border-collapse:collapse\'>\r\t<tr>\r\t\t<td colspan=3><p class=boxl style=\'margin-top:0cm;margin-bottom:0cm\'><span class="comp">(Public) class/subclass MusicFile extends/inherits</span></p></td>\r\t</tr>\r\t<tr>\r\t\t<td width=400 valign=top><p class=boxl style=\'margin-top:0cm;margin-bottom:0cm\'><span style=\'font-family:Courier New;font-size:10pt\'>\r&nbsp;&nbsp;&nbsp;MediaFile {<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public void PlayFile (Override)<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public string GetArtist()<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public float GetSampleRate() <br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public int GetBitDepth()<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private string Artist<br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private float SampleRate <br>\r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private int BitDepth<br>}\r</span></p></td>\r\t\t<td width=30 valign=top><p class=boxl><br><img height=120 align="middle;" src="AA_COM/MS10311_files_M/brackets.png"></p></td>\r\t\t<td width=30 valign=top><p class=boxl style=\'margin-top:0cm;margin-bottom:0cm\'><span class="comp"><span class="comp">1<br>1<br><br>1<br><br><br>1</p></span></td>\r\t</tr>\r</table>\r<p class="indent2new indentright"><i>1 mark for correct header including name of class and parent class;<br/>1 mark for redefining the PlayFile procedure;<br/>1 mark for defining all 3 extra <u>functions</u> needed to read variable values;<br/>1 mark for defining all 3 extra properties, with appropriate data types as private;</i><br><br/><b>A</b> any numeric types for SampleRate and BitDepth<br/><b>DPT</b> if any extra functions/procedures/variables included but do not penalise answers that have extra procedures to set variable values.<br/><b>DPT</b> if any of the functions/procedures are private<br/><b>I</b> parameters to methods, minor changes to names that do not affect clarity, case<br/><b>A</b> mixes of two methods if meaning is clear</p>\r<p class="levelms">4</p> \r<p class="mark">[9]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Part (a): Most candidates were able to explain what inheritance meant. Marks were sometimes lost because candidates wrote about a child class sharing &#x2018;things&#x2019; with its parent, rather than methods or properties.</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">Part (b): The inheritance diagram was poorly drawn, surprisingly. Many candidates failed to put boxes around the class names or to put arrowheads on the lines and consequently lost marks.<br/>Candidates need to remember to do both of these things.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">Part (c): Answers to this question part were quite mixed. Overriding is when a method from a parent class is redefined with the same name by a child class to perform a different function.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">Part (d): Most candidates got some marks for this question part but full mark responses were seen very infrequently. Common mistakes were to incorrectly redeclare the fields and methods from the parent class and to forget to override the PlayFile function.</p></h5>', 'notes': '', 'resources': ''}, 'QW08404': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">A library system uses three classes, <b>BookCopy</b>, <b>Borrower</b> and <b>Loan</b>. A BookCopy object represents a book, a Borrower object represents someone who borrows books and a Loan object represents the loan of a single BookCopy to a Borrower.</span></p>  \r<p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; Draw a class diagram to represent the relationships between these classes.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(3)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; The Borrower class has data fields Name and Address. The class definition for Borrower is</p>  \r<p class="indent2"><span class="comp-top">Borrower = Class</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Public</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure AddNewBorrower</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure AmendBorrowerDetails</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure GetBorrowerDetails</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Private</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Name : String</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Address : String</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">End</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new"> The BookCopy class has data fields Title, Author, OnLoan and ISBN. The class definition for BookCopy is</p>  \r<p class="indent2"><span class="comp">BookCopy = Class</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Public</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure AddNewBookCopy</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure ChangeLoanStatus</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Procedure GetBookDetails</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Private</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Title : String</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Author : String</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">OnLoan : Boolean</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">ISBN : String</span></p>  \r<p class="indent3" style=\'margin-top:3.0pt\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">End</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new"> The Loan class needs operations (methods) to create a loan, delete a loan and get loan details. The data fields are the person, the book loaned, the date of the loan and the date of return.</p>  \r<p class="indent2">Write the class definition for the Loan class.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(4)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; The library has decided to introduce short-loan books in addition to standard-loan books. How would you modify the BookCopy class to allow for this change?</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(2)</p>  \r<p class="mark">(Total 9 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)</span></p>  \r<p class="indent2 indentright m-t-0"><img width=435 height=43 src="AA_COM/MW08404_files_M/image001.jpg">&nbsp;</p>  \r<p class="indent2 indentright"><i>1 mark for correct boxes</i></p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for correct lines</i></p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for correct line endings</i></p>  \r<p class="levelms">3</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1a indentright" >(b)&nbsp;&nbsp;&nbsp;&nbsp; <span class="comp">Loan = class</p>  </span>\r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public</p>  </span> \r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure CreateLoan</p>   </span>\r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure DeleteLoan</p>   </span>\r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure GetLoanDetails;</p>  </span> \r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Private</p>   </span>\r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Person: Borrower</p>   </span>\r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BookLoaned: BookCopy;</p>  </span> \r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DateOfLoan:  Time/Date&nbsp;&nbsp; </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<b>A</b> string</p>  \r<p class="indent3 indentright m-t-0"><span class="comp">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReturnDate:  Time/Date;&nbsp; </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>A</b> string</p>  \r<p class="indent3 indentright m-t-0"><span class="comp">End;</p>   </span>\r<p class="indent2 indentright"><i>1 mark for <span class="comp">Loan = Class + Public + Private + End</i></span></p>  \r<p class="indent2 indentright m-t-0">1 mark for <span class="comp">CreateLoan + DeleteLoan + GetLoanDetails</span></p>  \r<p class="indent2 indentright m-t-0">1 mark for <span class="comp">Person + BookLoaned</span></p>  \r<p class="indent2 indentright m-t-0">1 mark for <span class="comp">DateOfLoan + ReturnDate</span></p>  \r<p class="indent2 indentright m-t-0"><b>A</b> any reasonable names for operations and data items.</p>  \r<p class="levelms">4</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; Add a new data item ShortLoan; of type Boolean;<br><b>A</b> loanlength; integer;<br><b>A</b> loantype; string;</p>  \r<p class="indent2 indentright">Modify the code for the operations;</p>  \r<p class="levelms">Max 2</p>  \r<p class="mark">[9]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The class diagram was a challenge to most candidates. Most candidates assumed that it was an inheritance relationship. As a result they often lost marks later in the question as well. Class definitions were given in this question and this should have allowed candidates to score very highly in part (b). This was not the case as many candidates did not read the question carefully enough. Very few candidates realised that Person and BookLoaned needed to be of types Borrower and BookCopy respectively. While many candidates realised that the solution to part (c) was to add an additional variable, many candidates seemed to think that an extra procedure was required.</span></p></h5>', 'notes': '', 'resources': ''}, 'QS07407': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; In object-oriented programming, what is meant by aggregation?</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; An object-oriented program is required to handle details of items of furniture that are for sale. The furniture sold includes dining suites. A dining suite consists of a table and a number of chairs.</p>  \r<p class="indent2new">Some fields required for the suites are</p>  \r<p class="indent3new m-t-0">TableType</p>  \r<p class="indent3new m-t-0">ChairType</p>  \r<p class="indent3new m-t-0">NumberOfChairs</p>  \r<p class="indent2new">A method required for the suites is</p>  \r<p class="indent3new m-t-0">DisplayDetails</p>  \r<p class="indent2new">Some fields required for the tables are</p>  \r<p class="indent3new m-t-0">TableType</p>  \r<p class="indent3new m-t-0">Size</p>  \r<p class="indent3new m-t-0">Colour</p>  \r<p class="indent2new">Some fields required for the chairs are</p>  \r<p class="indent3new m-t-0">ChairType</p>  \r<p class="indent3new m-t-0">Colour</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2">(i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Draw <b>a class diagram</b> of these classes, Suite, Table and Chair.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p>  \r<p class="indent2">(ii)&nbsp;&nbsp;&nbsp;&nbsp; Write class definitions for Chair, Table and Suite.</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="mark">(8)</p>  \r<p class="mark">(Total 11 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; An object that contains other objects;</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> a class containing other classes;</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1a indentright" >(b)&nbsp;&nbsp;&nbsp;&nbsp; (i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent3 m-t-0"><img width=429 height=267 src="AA_COM/MS07407_files_M/image001.png">&nbsp;</p>  \r<p class="indent3new indentright"><i>1 mark for class entries<br>1 mark for connections</i></p>\r<p class="indent3new indentright m-t-0"><b>A</b> circles or diamonds, filled or not</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2 indentright">(ii)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent3 m-t-0"><img src="AA_COM/MS07407_files_M/img01.png">&nbsp;</p>  \r<p class="indent3new indentright"><b>A</b> any sensible syntax<br><b>R</b> implied inheritance</p>\r<p class="levelms">Max 8</p>  \r<p class="mark">[11]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Very few candidates scored well on this question. Aggregation was a mystery to most candidates. Many answers described inheritance and then went on to give class definitions using inheritance. Hardly any candidates were able to draw a class diagram using the correct symbols. It was disappointing to see the number of answers that suggested that the candidates had not had experience of object oriented programming. The concepts of private and public were often misused and incorrect data types were often suggested.</p></h5>', 'notes': '', 'resources': ''}, 'QW07408': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Many programs executed within a Graphical User Interface (GUI) environment are <i>object-oriented</i> and <i>event-driven.</i></p>  \r<p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; Give an example of an event in this context.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; Describe how event-driven programs differ from non event-driven programs.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; List <b>two</b> features of an object.</p>  \r<p class="indent2new answer-toggle">1. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">2. _________________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(d)&nbsp;&nbsp;&nbsp;&nbsp; Name an object that might be part of a GUI.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(1)</p>  \r<p class="mark">(Total 6 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; Mouse click// mouse movement// keyboard operation// any interrupt;</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; Event-driven programs service an event and wait for another; non event-driven programs run to completion/ are sequential;</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; Contains its own data/fields/variables/properties;</p>  \r<p class="indent2new indentright m-t-0">Contains its own</p>  \r<p class="indent2new indentright m-t-0">Operations/methods/functions/procedures/behaviours/code;</p>  \r<p class="indent2new indentright m-t-0">Responds to messages;</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> Based on a Class definition</p>  \r<p class="levelms">Max 2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(d)&nbsp;&nbsp;&nbsp;&nbsp; Frame/form/window/button/check box/radio button/menu/text box;</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> any sensible widget</p>  \r<p class="indent2new indentright m-t-0"><b>R</b> Plurals</p>  \r<p class="levelms">1</p>  \r<p class="mark">[6]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">It is hard to understand why so many candidates were unable to gain good marks for this question since all will be very familiar with GUIs. Many candidates used poor language and were unable to express themselves but there is a greater worry that candidates do not seem to understand how the underlying object-oriented system operates. It was common misconception that an event is something the user does. There were also many candidates who did not seem to understand the event handling mechanism. Once again many marks were lost due to poor explanations in part (b). Part (c) showed that many candidates do not understand object-oriented programming and it appeared that they had not been exposed to this technique.</p></h5>', 'notes': '', 'resources': ''}, 'QW06406': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">For an object-oriented program to store and retrieve details of a company’s vehicles, a Vehicle class is needed.<b> two </b>subclasses have been identified: <b>Car</b> and <b>Van</b>, which have inheritance relationships with class <b>Vehicle</b>.</p>  \r<p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; Draw an inheritance diagram for these classes.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; The Vehicle class has data fields RegistrationNumber, Make, Colour. The class definition for Vehicle is</p>  \r<p class="indent2new"><span class="comp-top">Vehicle&nbsp; =&nbsp; Class<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure &nbsp;&nbsp; SetVehicleDetails<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Function&nbsp; &nbsp;&nbsp; GetRegistrationNumber<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Function&nbsp; &nbsp;&nbsp; GetMake<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Function&nbsp; &nbsp;&nbsp; GetColour <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Private<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RegistrationNumber : String<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Make :&nbsp; String<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Colour&nbsp;&nbsp; :&nbsp;&nbsp; String <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">While preserving the private status of the Colour field, what modification would you make to this class definition in order to allow the colour of the vehicle to be changed?</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; The Van class has additional private data fields:</p>  \r<p class="indent2">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Capacity that represents the weight that can be carried in kilograms;</p>  \r<p class="indent2 m-t-0">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TailLift that represents whether the van has a tail lift or not.</p>  \r<p class="indent2new">Write the class definition for <b>Van</b>.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(6)</p>  \r<p class="mark">(Total 10 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent2 m-t-0"><img width=367 height=175 id="Picture 1" src="AA_COM/MW06406_files_M/image001.png" alt=mW06406>&nbsp;</p>  \r<p class="indent2new indentright m-t-0"><i>1 mark for all three classes in appropriate single enclosures </i></p>  \r<p class="indent2new indentright m-t-0"><i>1 mark for correct independent arrows in correct directions</i></p>  \r<p class="levelms">2</p>  \r<p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; (Insert) a SetColour Procedure; </p>  \r<p class="indent2new indentright m-t-0"><b>A </b>Function into the Public section; </p>  \r<p class="indent2new indentright m-t-0"><b>R </b>make Colour Public</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; <u>Van</u> = Class/ sub<u>class</u> (<u>Vehicle</u>)ie. Clearly identify Van as a (sub) class of vehicle</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">(Public)</p>  \r<p class="indent2new indentright">Procedure SetVehicleDetails (Override) condone if not included</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">Function GetCapacity </p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">Function GetTailLift</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">(penalise extra functions/procedures once) </p>  \r<p class="indent2new indentright m-t-0">Private</p>  \r<p class="indent2new indentright">Capacity : Integer/real/fixed/float</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">TailLift: Boolean</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright"><i>penalise once if not private and once if extra variables listed) </i></p>\r<p class="indent2new indentright">End</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright"><b>A</b></span><b> </b><span class=indent2Char>Procedure</span> SetCapacity and Procedure SetTailLift/</p>  \r<p class="indent2new indentright m-t-0"><b>A</b>Procedure AddNewVan instead of Procedure SetVehicleDetails</p>  \r<p class="indent2new indentright"><b>OR</b></p>  \r<p class="indent2new indentright">Public class/subclass Van extends/inherits Vehicle</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">{</p>  \r<p class="indent2new indentright">public void SetVehicleDetails</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">public int GetCapacity</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">public boolean/int GetTailLift </p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">private int Capacity</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright">private boolean/int TailLift</p>  \r<p class="indent2new m-t-0"><i>1 mark</i></p> \r<p class="indent2new indentright"><b>A </b>public void SetCapacity and public void SetTailLift//public void AddNewVan instead of public void SetVehicleDetails </p>  \r<p class="indent2new indentright m-t-0"><b>R </b>any diagrams </p>  \r<p class="indent2new indentright m-t-0"><b>I </b>any parameters to methods</p>  \r<p class="levelms">6</p>  \r<p class="mark">[10]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">The inheritance diagram for part (a) returned two very easy marks for a large majority of candidates. The question then got harder but, as a whole, discriminated very well, indeed. In part (b) the examiners expected that the candidates would state that a public procedure should be inserted to set the colour. Where a candidate wrote of a function instead of a procedure the answer was condoned.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">It was hoped that candidates would apply the concept of inheritance in part (c) and introduce functions GetCapacity and GetTailLift with an override of the procedure SetVehicleDetails. The candidates were also expected to choose suitable data types for the two new data fields. Since only six marks were available for the class definition as a whole it was marked quite leniently with regard to the use of Get and Set in the function names. In future examinations, however, similar questions may well be assessed more strictly. Even with the generous mark scheme only a few candidates obtained all six marks in part (c).</p></h5>', 'notes': '', 'resources': ''}, 'QS05407': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; In object-oriented programming, what is meant by inheritance?</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; An object-oriented program is required to handle details of a lending library’s books and CDs.</p>  \r<p class="indent2new">Some fields required for the books are:</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>Title,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>Author,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>ISBN,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>OnLoan,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>DateAcquired.</p>  \r<p class="indent2new">Some fields required for the CDs are:</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>Title,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>Artist,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>PlayingTime,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>OnLoan,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>DateAcquired.</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>Some methods required are:</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>SetLoan,</p>  \r<p class="indent2new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:56.9pt;margin-bottom:.0001pt\'>DisplayDetails</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">This could be implemented by declaring two separate classes Book and CD. This would result in a lot of repetitive code. Making use of inheritance, <b>write</b> class definitions for one superclass <b>StockItem</b> and two subclasses <b>Book</b> and <b>CD</b>.</p>  \r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="indent2new answer-toggle">&nbsp;</p>\r<p class="mark">(7)</p>  \r<p class="mark">(Total 8 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; A class has <u>properties/fields/attributes/characteristics and methods/procedures/functions</u> of the parent class it is derived from // a subclass/derived class inherits all the <u>properties/fields/attributes/characteristics </u>and <u>methods/procedures/functions</u> from a super-class/base-class/parent class;</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; StockItem (=) Class <b>//</b> Class (=) StockItem;</p>  \r<p class="indent2new indentright"><i>1 mark for keywords Class and StockItem</i></p>  \r<p class="indent2new indentright m-t-0">(<b><i>A</i></b> Object instead of Class) </p>  \r<p class="indent2new indentright"><img id="Picture 3" src="AA_COM/MS05407_files_M/img01.png">&nbsp;</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright">Book = Class (StockItem) // Class Book extends/derives from StockItem</p>  \r<p class="indent2new indentright m-t-0">// Book Subclass: StockItem;</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> without keyword Class</p>  \r<p class="indent2new indentright"><img id="Picture 2" src="AA_COM/MS05407_files_M/img02.png" alt=MS05407b>&nbsp;</p>  \r<p class="indent2new indentright"><i>If candidate declared \x91getters\x92 and \x91setters\x92 for the base class fields then don\x92t have to have DisplayDetails as a base class method</i></p>  \r<p class="indent2new indentright"><img id="Picture 1" src="AA_COM/MS05407_files_M/img03.png" alt=MS05407c>&nbsp;</p>  \r<p class="indent2new indentright"><i>No marks for a diagrammatic answer.</i></p>  \r<p class="indent2new indentright"><b>I</b><b><span style=\'font-family:TimesNewRomanPS-BoldMT\'> </span></b>method parameters</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright">Java version:</p>  \r<p class="indent2new indentright m-t-0">Public Class StockItem</p>  \r<p class="indent2new indentright m-t-0">{</p>  \r<p class="indent2new indentright m-t-0">Private String title;</p>  \r<p class="indent2new indentright m-t-0">Private boolean onLoan;</p>  \r<p class="indent2new indentright m-t-0">Private String dateAquired;</p>  \r<p class="indent2new indentright m-t-0">Public void displayDetails ();</p>  \r<p class="indent2new indentright m-t-0">Public void setLoan ();</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright">}</p>  \r<p class="indent2new indentright m-t-0">Public Class Book extends StockItem</p>  \r<p class="indent2new indentright m-t-0">{</p>  \r<p class="indent2new indentright m-t-0">Private string author;</p>  \r<p class="indent2new indentright m-t-0">Private string isbn;</p>  \r<p class="indent2new indentright m-t-0">Public void displayDetails ();</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new indentright">}</p>  \r<p class="indent2new indentright m-t-0">Public Class CD extends StockItem</p>  \r<p class="indent2new indentright m-t-0">{</p>  \r<p class="indent2new indentright m-t-0">Private string artist;</p>  \r<p class="indent2new indentright m-t-0">Private integer playingTime;</p>  \r<p class="indent2new indentright m-t-0">Public void displayDetails();</p>  \r<p class="indent2new indentright m-t-0">}</p>  \r<p class="levelms">Max 7</p>  \r<p class="mark">[8]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; Not many candidates could explain that inheritance is when a class gains the methods and properties of another class, while having some of its own methods and/or properties. Many candidates mixed up the terms object and class indiscriminately.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; Many candidates seemed to lack the knowledge and skill to structure a class definition, even though this topic has been examined many times before.</p>  \r<p class="indent2new">An example of an answer worthy of full marks is:</p>  \r<p class="indent2new"><span class="comp">Type StockItem = Class<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure DisplayDetails : virtual;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure SetLoan;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Private<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Title: String;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OnLoan: Boolean;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DateAcquired: Date;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End;</span></p>  \r<p class="indent2new"><span class="comp">Type Book = Class (StockItem)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure DisplayDetails: override;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Private<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Author: String;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ISBN: String;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End;</span></p>  \r<p class="indent2new"><span class="comp">Type CD = Class (StockItem)<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Public<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Procedure DisplayDetails: override;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Private<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Artist: String;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PlayingTime: Integer;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End;</span></p>  \r<p class="indent2new">Syntax of other languages such as Java was just as acceptable.</p></h5>', 'notes': '', 'resources': ''}, 'QW05405': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; State <b>two</b> advantages of the object-oriented approach to program design over the structured approach to program design.</p>  \r<p class="indent2new answer-toggle">1. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">2. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; A golf club keeps details of its members. Each member has a unique membership number, first name, surname and telephone number recorded. Three classes have been identified:</p>  \r<p class="indent2new">Member</p>  \r<p class="indent2new m-t-0">MidWeekMember</p>  \r<p class="indent2new m-t-0">FullMember</p>  \r<p class="indent2new">The classes <i>MidWeekMember </i>and <i>FullMember</i> are related, by single inheritance, to the class Member.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">Draw an inheritance diagram for the given classes.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; Programs that use objects of the class <i>Member </i>need to add a new member’s details, amend a member’s details, and show a member’s details. No other form of access is to be allowed. Write a class definition for this class.</p>  \r<p class="indent2new"><span class="comp">Member = Class</span></p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new"><span class="comp">End</span></p>  \r<p class="mark">(4)</p>  \r<p class="mark">(Total 8 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; Produces re-useable code because of inheritance/encapsulation;</p>  \r<p class="indent2new indentright m-t-0">Produces re-useable objects;</p>  \r<p class="indent2new indentright m-t-0">Data is protected // only accessible in well-defined ways (because of encapsulation);</p>  \r<p class="indent2new indentright m-t-0">More efficient to write programs which use pre-defined / inherited objects / classes;</p>  \r<p class="indent2new indentright m-t-0">Storage structure of data and method code of a class may be altered without affecting programs that make use of the class;</p>  \r<p class="indent2new indentright m-t-0">Code produced contains fewer errors / more reliable;</p>  \r<p class="indent2new indentright m-t-0">Solutions are easier to understand (when expressed in terms of objects);</p>  \r<p class="indent2new indentright m-t-0">Easier to enforce design consistency; easier to debug;</p>  \r<p class="indent2new indentright m-t-0">Less maintenance effort required by developer since objects can be re-used;</p>  \r<p class="indent2new indentright m-t-0">New functions can be added to objects easily (because of inheritance);</p>  \r<p class="indent2new indentright m-t-0"><b>R</b> Easier to program</p>  \r<p class="indent2 indentright m-t-0"><b>I</b> references to GUIs</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; <i>1 mark for correct base class and derived classes incl. containers;</i></p>  \r<p class="indent2new indentright m-t-0"><i>1 mark for 2 correctly directed arrows;</i></p>  \r<p class="indent2new indentright m-t-0"><b>R</b> E-R diagrams<br> <b>I </b>methods listed in containers</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; Member = Class</p>  \r<p class="indent2new indentright m-t-0">(Public)</p>  \r<p class="indent2new indentright m-t-0">(procedure) AddNewMember(s);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>  \r<p class="indent2new indentright m-t-0">(procedure) AmendMember(s)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;&nbsp;&nbsp; <i>no mark if methods are private</i></p>  \r<p class="indent2new indentright m-t-0">(Procedure) ShowMember(s);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> proc instead of procedure<br> <b>R</b> function instead of procedure</p>  \r<p class="indent2new indentright">Private&nbsp;&nbsp;&nbsp;&nbsp; <i>(1 mark for all data fields marked as private)</i></p>  \r<p class="indent2new indentright m-t-0">MembershipNo : Integer &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<b>A</b> string/text as data type <b>R</b> number</p>  \r<p class="indent2new indentright m-t-0">FirstName: string/text &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };</p>  \r<p class="indent2new indentright m-t-0">Surname: String/text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> ID</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> FName</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> SName</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> Tel</p>  \r<p class="bottom">&nbsp;</p>  \r<p class="indent2new indentright">TelephoneNumber: string/text : <br><b>R </b>number/integer as data type</p>  \r<p class="indent2new indentright m-t-0">End (Class)</p>  \r<p class="indent2new indentright"><i>Public may come after Private. Each line may be preceded by Public or Private &amp; in no particular order</i><br><b>R</b> diagrammatic answer <br><b>I</b> case <br><b>I</b> white space</p>  \r<p class="levelms">4</p>  \r<p class="mark">[8]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">In part (a) few candidates could give advantages of the object-oriented approach to programming. Many candidates are under the false impression that object-oriented programming means using environments such as Delphi or Visual Basic where beginners can get a working program with a nice user interface without much programming of their own. Few candidates also noticed that OOP should be compared to the structured approach. So re-useable code is not sufficient, since that is possible in the structured approach also. OOP produces re-useable objects, however, is a response worthy of a mark. Other acceptable advantages were: data is accessible in well-defined ways because of encapsulation; it is time-saving to write programs which use pre-defined objects; solutions are easier to understand when expressed in terms of objects.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">For part (b), the drawing of inheritance diagrams have been required for several years now and candidates are expected to draw these in standard format:</p>  \r<p class="graph"><img width=197 height=170 id="Picture 1" src="AA_COM/EW05405_files_E/image001.png" alt=EW05405></p>  \r<p class="indent1new">It is important to convey the hierarchy (the super class above the sub-class) and draw the arrow from the sub-class to the super class. Classes should be shown in circles, rectangles or oval shapes.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1new">Part (c) expected the class definition of Member, not of any subclasses. The required methods and fields were clearly stated in the question. Candidates needed to ensure that methods were public and fields private and the right data type. Some candidates still seem to be under the false impression that a telephone number can be stored in an integer data type. Candidates should also be aware that the choice of identifiers is important since this is the programmer’s interface when using an object, so meaningless abbreviations such as Tno instead of TelephoneNumber were not acceptable. A correct answer is:</p>  \r<p class="indent2new"><span class="comp">Member = Class<br> </span><span class=indent1newChar><span style=\'font-size:10.0pt;font-family: "Courier New"\'>Public<br> &nbsp; Procedure AddNewMemberDetails<br> &nbsp; Procedure AmendMemberDetails<br> &nbsp; Procedure ShowMemberDetails<br> Private MembershipNumber: Integer<br> &nbsp; FirstName : String<br> &nbsp; Surname: String<br> &nbsp; TelephoneNumber: String<br> End</span></span></p>  \r<p class="indent1new">Credit was also given to answers that followed Java-style syntax.<br> Diagrams were not accepted.</p></h5>', 'notes': '', 'resources': ''}, 'QS0443A': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">For an object-oriented program to store and calculate payroll details for an organisation, an Employee class is needed. A subclass has been identified: <b>HourlyPaidEmployee</b>, which has an inheritance relationship with class <b>Employee</b>.</p>  \r<p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; Draw an inheritance diagram for these classes.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; The <b>Employee</b> class has data fields <i>Name</i>, <i>National Insurance Number</i>, <i>Annual Pay</i>, <i>Gross Pay To Date</i>.</p>  \r<p class="indent2new">The class definition for <b>Employee</b> is</p>  \r<p class="indent3" style=\'margin-left:5.0cm;text-indent:-2.0cm\'><span class="comp">TEmployee = Class<br> &nbsp; Public<br> &nbsp;&nbsp;&nbsp;&nbsp; Procedure&nbsp; AddNewEmployee<br> &nbsp;&nbsp;&nbsp;&nbsp; Procedure&nbsp; AmendEmployeeDetails<br> &nbsp;&nbsp;&nbsp;&nbsp; Procedure&nbsp; PrintPaySlip<br> &nbsp;&nbsp;&nbsp;&nbsp; Procedure&nbsp; CalculatePay<br> &nbsp; Private<br> &nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp; :&nbsp; String<br> &nbsp;&nbsp;&nbsp;&nbsp; NationalInsuranceNumber&nbsp; :&nbsp; String<br> &nbsp;&nbsp;&nbsp;&nbsp; Annual Pay&nbsp; :&nbsp; Currency<br> &nbsp;&nbsp;&nbsp;&nbsp; GrossPayToDate&nbsp; :&nbsp; Currency<br> End</span></p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">Monthly pay for an employee object of <b>TEmployee</b> class definition is calculated differently from the monthly pay for an employee object of <b>THourlyPaidEmployee</b> class definition.</p>  \r<p class="indent2new">In the case of an employee object of class definition</p>  \r<p class="indent2">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>THourlyPaidEmployee</b>: monthly pay is calculated by multiplying number of hours worked in month by hourly pay rate.</p>  \r<p class="indent2 m-t-0">•&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>TEmployee</b>: monthly pay is calculated by dividing the annual pay by 12.</p>  \r<p class="indent2new">An hourly paid employee object needs one additional operation, which collects the number of hours worked in a month.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">Write the class definition <b>THourlyPaidEmployee:</b></p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(6)</p>  \r<p class="mark">(Total 8 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent2new indentright m-t-0"><img width=256 height=244 id="Picture 1" src="AA_COM/MS0443A_files_M/image001.png">&nbsp;</p>  \r<p class="indent2new indentright m-t-0"><i>1 mark if correct hierarchy (including rectangles or round/oval shapes) in an inheritance diagram;</i></p>  \r<p class="indent2new indentright m-t-0"><b>A </b>no shapes this year only</p>  \r<p class="indent2new indentright m-t-0"><i>1 mark for arrow in correct direction</i></p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; THourlyPaidEmployee = Class (Employee)</p>  \r<p class="indent2new indentright m-t-0">(Public)</p>  \r<p class="indent2new indentright m-t-0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; procedure <u>CalculatePay</u> (override)</p>  \r<p class="indent2new indentright m-t-0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; procedure <u>Get</u>NumberOf<u>Hours</u>WorkedInMonth</p>  \r<p class="indent2new indentright m-t-0">Private</p>  \r<p class="indent2new indentright m-t-0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <u>hourlyrate</u>/<u>hourlypay</u>/Hourly<u>PayRate</u>: Currency</p>  \r<p class="indent2new indentright m-t-0">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NumberOf<u>Hours</u>WorkedInMonth : Integar/Real/Float</p>  \r<p class="indent2new indentright m-t-0">End</p>  \r<p class="indent2new indentright"><b>OR</b></p>  \r<p class="indent2new indentright">public class/subclas THourlyPaidEmployee extends/inherits TEmployee;{(1)</p>  \r<p class="indent2new indentright m-t-0">public void calculatePay;(1)</p>  \r<p class="indent2new indentright m-t-0">public void getNumberOfHoursWorkedInMonth;(1)</p>  \r<p class="indent2new indentright m-t-0">private; float hourlyPayRate;&nbsp; </p>  \r<p class="indent2new indentright m-t-0">private int numberOfHoursWorkedInMonth;(1)}</p>  \r<p class="indent2new indentright"><i>1 mark for private, 1 mark for var name</i></p>  \r<p class="indent2new indentright m-t-0"><i>Accept “Object” instead of “Class”</i></p>  \r<p class="indent2new indentright m-t-0"><i>Accept Public implied</i></p>  \r<p class="indent2new indentright m-t-0"><i>Lose one mark if properties from parent class included</i></p>  \r<p class="indent2new indentright m-t-0"><b><i>R</i></b><i> any diagrams</i></p>  \r<p class="levelms">6</p>  \r<p class="mark">[8]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; The drawing of inheritance diagrams has been required for several years now and candidates are expected to draw these in standard format:</p>  \r<p class="indent3"><a name="_1107806748"></a><a name="_1123486938"></a><a name="_1123488973"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img width=256 height=244 id="Picture 1" src="AA_COM/ES0443A_files_E/image001.png">&nbsp;</p>  \r<p class="indent2new">It is important to convey the hierarchy (the super class above the sub-class) and draw the arrow from the sub-class to the super class. Classes should be shown in circles or oval shapes.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)<span class=a>&nbsp;&nbsp;&nbsp;&nbsp; This question showed the class definition of TEmployee. The sub-class ThourlyEmployee inherits all the fields and methods of TEmployee. The stem of the question stated that pay is calculated differently for an employee object of TEmployee than for THourlyPaidEmployee. This should have alerted candidates that this method needs to be redefined. The question also states that an additional operation to collect the number of hours worked in a month was required. From this, candidates should be able to see that extra fields are also required to store the number of hours worked a month and the hourly pay rate. Taking account of inheritance, the definition of the subclass should therefore be:</span></p>  \r<p class="indent2new"><span class="comp">THourlyPaidEmployee =Class (TEmployee)<br> Public<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; procedure CalculatePay override<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; procedure GetNumberOfHoursWorkedInMonth<br> Private<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HourlyPayRate: Currency<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NumberOfHoursWorkedInMonth :Integer<br> End</span></p>  \r<p class="indent2new">Repeated declaration of fields from the parent class was not appropriate. Candidates also need to be aware that a sensible choice of identifiers is important as these are the interface for programmers using classes defined by others. For example the procedure identifier CalculateHoursWorked instead of GetHoursWorked did not gain credit.</p>  \r<p class="indent2new">Credit was also given to answers that followed a Java-style syntax.<br> Diagrams were not accepted.</p></h5>', 'notes': '', 'resources': ''}, 'QS03403': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">One of the concepts of Object Oriented Programming is <i>containment</i>.</p>  \r<p class="indent1new">Class TForm1 inherits from class TForm.</p>  \r<p class="indent1new">A form, Form1, of class Tform1, contains 2 buttons, Button1 and Button2, of class TButton.</p>  \r<p class="indent1new">Write the class definition for TForm1.</p>  \r<p class="indent1new answer-toggle">_______________________________________________________________________</p>  \r<p class="indent1new answer-toggle">_______________________________________________________________________</p>  \r<p class="indent1new answer-toggle">_______________________________________________________________________</p>  \r<p class="indent1new answer-toggle">_______________________________________________________________________</p>  \r<p class="mark">(Total 3 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">TForm1 = <u>Class</u>(TForm)(1)</p>  \r<p class="indent1new indentright">Button1:Tbutton;(1)</p>  \r<p class="indent1new indentright">Button2:Tbutton; (1)</p>  \r<p class="indent1new indentright">End</p>  \r<p class="indent1new indentright"><i>NB 1 mark for BOTH buttons</i></p>\r<p class="indent1new indentright">//</p>  \r<p class="indent2 indentright" style=\'margin-left:4.0cm;text-indent:-2.0cm\'><u>Class</u> Tform1 extends Tform<br> {Tbutton Button1;<br> Tbutton Button 2;<br> }</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright"><i>Must look like code.</i></p>  \r<p class="indent1 indentright m-t-0"><i>1 mark for connecting TForm1 to Tform <b>A </b>inherits, :</i></p>  \r<p class="indent1 indentright m-t-0"><i>1 mark for defining both buttons as type Tbutton <b>A </b>As</i></p>  \r<p class="indent1 indentright m-t-0"><i>1 mark for {} or End</i></p>  \r<p class="mark">[3]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Some candidates simply re-wrote the question. Others gave quite commendable inheritance diagrams, which, as they were not asked for, gained no marks. Examiners were lenient in their assessment here, giving marks for genuine attempts at coding.</p></h5>', 'notes': '', 'resources': ''}, 'QW03410': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; State <b>two </b>advantages of the object-oriented approach to program design over the structured approach to program design.</p>  \r<p class="indent2new answer-toggle">1. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">2. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; A sailing club has both junior and senior members. Each member has a unique membership number, a name and an address recorded. Three classes have been identified:</p>  \r<p class="indent2new">Member</p>  \r<p class="indent2new m-t-0">JuniorMember</p>  \r<p class="indent2new m-t-0">SeniorMember</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">The classes JuniorMember and SeniorMember are related, by single inheritance, to the class Member.</p>  \r<p class="indent2new">Draw an inheritance diagram for the given classes.</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="indent1new answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; Programs that use objects of the class Member need to add a new member’s details, amend a member’s details, and show a member’s details. No other form of access is to be allowed. Write a class definition for this class.</p>  \r<p class="indent2new">Member = <b>Class</b></p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new">___________________________________________________________________</p>  \r<p class="indent2new"><b>End</b>;</p>  \r<p class="mark">(4)</p>  \r<p class="mark">(Total 8 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; Produces re-usable code because of inheritance / encapsulation;</p>  \r<p class="indent2new indentright m-t-0">Data is only accessible in well defined ways (because encapsulated);</p>  \r<p class="indent2new indentright m-t-0">More efficient to write programs which uses pre-defined / inherited objects / classes;</p>  \r<p class="indent2new indentright m-t-0">Storage structure of data and the code in an object may be altered without affecting programs that make use of the object;</p>  \r<p class="indent2new indentright m-t-0">Code produced contains fewer errors / more reliable;</p>  \r<p class="indent2new indentright m-t-0">Solutions are easier to understand when expressed in terms of objects;</p>  \r<p class="indent2new indentright m-t-0">Easier to enforce design consistency – Windows GUI functionality;</p>  \r<p class="indent2new indentright m-t-0">Cheaper production costs / Less maintenance effort required by developer since reliable ‘objects’ can be re-used / bought in;</p>  \r<p class="indent2new indentright m-t-0">New functions can be added to objects easily (because encapsulated);</p>  \r<p class="indent2new indentright"><i>Any 2 advantages × 1 each – must state an advantage, not make a statement.</i></p>  \r<p class="indent2new indentright m-t-0"><b>R</b> Object is independent.</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent2 indentright m-t-0"><img width=379 height=168 id="Picture 1" src="AA_COM/MW03410_files_M/image001.png">&nbsp;</p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for correct base class and derived classes ;</i></p>  \r<p class="indent2 indentright m-t-0"><i>1 for 2 correctly directed arrows. ;</i></p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; Member = <b>Class</b><br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Procedure) AddNewMembers;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Procedure) AmendMembers;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Procedure)ShowMembers;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>Private</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MembershipNo : Integer<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name : String;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Address : String;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>End;</b></p>  \r<p class="indent2new indentright"><i>Exact syntax not required, but must be in style of . 3 procedures (1)</i></p>  \r<p class="indent2new indentright m-t-0"><i>Private (1)</i></p>  \r<p class="indent2new indentright m-t-0"><i>All 3 field (property) names (1)</i></p>  \r<p class="indent2new indentright m-t-0"><i>3 reasonable data types (1)</i></p>  \r<p class="levelms">4</p>  \r<p class="mark">[8]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Again, vague answers lost marks in this question on object oriented programming, although it was felt that candidates were more familiar with this topic than previously. To say that two advantages of an object oriented approach were ‘can add new code more efficiently’ and ‘easier to program’ is not creditworthy.</p>  \r<p class="indent1new">The terms ‘inheritance’ and ‘encapsulation’ were liberally scattered over the page, but rarely in a context that gave two advantages of the object oriented approach. The term ‘modules’ was often used in place of ‘objects’ or ‘classes’, which made an otherwise intelligent answer incorrect. A good candidate wrote ‘Data and instructions are encapsulated into the object, therefore objects can be reused’, and, ‘Attributes and activities can be inherited by subclasses meaning less new code is required.’</p>  \r<p class="indent1new">Most candidates drew a correct inheritance diagram for the classes described in part (b), but few gained marks for writing the class definition in part (c), although considerable latitude was given in assessing their efforts.</p></h5>', 'notes': '', 'resources': ''}, 'QS02407': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">A supermarket has a section labelled ‘Bottled Water’.&nbsp; Bottled water comes as ‘still bottled water’ or ‘carbonated bottled water’.</p>  \r<p class="indent1new">In an object-oriented program, ‘bottled water’, ‘still bottled water’ and ‘carbonated bottled water’ are three defined <i>classes.&nbsp; </i>The classes ‘still bottled water’ and ‘carbonated bottled water’ are related, by single <i>inheritance, </i>to ‘bottled water’.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; What is meant here by</p>  \r<p class="indent2new">(i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class?<span  "answer-toggle"> ________________________________________________________</span></p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2new">(ii)&nbsp;&nbsp;&nbsp;&nbsp; inheritance?<span  "answer-toggle"> ____________________________________________________</span></p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; Draw an inheritance diagram for the given classes.</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="indent1new m-t-0 answer-toggle">&nbsp;</p>  \r<p class="mark">(3)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(c)&nbsp;&nbsp;&nbsp;&nbsp; Give <b>three </b>advantages of the object-oriented approach to programming over a structured approach.</p>  \r<p class="indent2new answer-toggle">1. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">2. _________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">3. _________________________________________________________________</p> \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(3)</p>  \r<p class="mark">(Total 8 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1a indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; (i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>A class</b></p>  \r<p class="indent3new indentright m-t-0">A grouping of data structures and behaviours / methods / procedures / functions; A set of objects / object type which share a common <u>data structure</u> and common <u>behaviour</u> / <u>methods / procedures / functions;</u></p>  \r<p class="indent3 indentright"><i>Need both structure and behaviour </i></p>  \r<p class="indent3 indentright" style=\'margin-top:0cm;margin-right:1.0cm;margin-bottom:12.0pt; margin-left:4.0cm\'><b>A</b> variables, attributes</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2 indentright">(ii)&nbsp;&nbsp;&nbsp;&nbsp; <b>Inheritance</b></p>  \r<p class="indent3new indentright m-t-0">Relationship among classes wherein one class shares the data structure and behaviour/methods / procedures / functions / actions of another class</p>  \r<p class="indent3new indentright"><b>OR</b> when a class has the same characteristics as its parent class</p>  \r<p class="indent3new indentright m-t-0"><b>A</b> attributes / features / properties</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent2 indentright m-t-0"><img width=368 height=141 id="Picture 1" src="AA_COM/MS02407_files_M/image001.png">&nbsp;</p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for correct base class</i></p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for two correct derived classes</i></p>  \r<p class="indent2 indentright m-t-0"><i>1 mark for <b>2</b> correctly directed arrows</i></p>  \r<p class="levelms">3</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(c)&nbsp;&nbsp;&nbsp;&nbsp; <b>Advantages</b></p>  \r<p class="indent2new indentright m-t-0">Produces re-usable components (you do not have to know how they are written);</p>  \r<p class="indent2new indentright m-t-0"><b>A</b> code</p>  \r<p class="indent2new indentright m-t-0">Data is protected – only accessible in well defined ways;</p>  \r<p class="indent2new indentright m-t-0">Easier to write programs which use pre-defined objects / classes;</p>  \r<p class="indent2new indentright m-t-0">Storage structures of data of an object may be altered without affecting programs that make use of the object;</p>  \r<p class="indent2new indentright m-t-0">Code of an object may be altered without affecting programs that make use of the object;</p>  \r<p class="indent2new indentright m-t-0">Solutions that use objects tend to contain fewer errors / more reliable;</p>  \r<p class="indent2new indentright m-t-0">Solutions are easier to understand when expressed in terms of objects;</p>  \r<p class="indent2new indentright m-t-0">Easier to enforce design consistency;</p>  \r<p class="indent2new indentright m-t-0">Cheaper production costs when software can be re=used;</p>  \r<p class="indent2new indentright m-t-0">Less maintenance effort required by developer since reliable ‘objects’ can be bought in;</p>  \r<p class="indent2new indentright m-t-0">New functions / features can be added to objects / classes easily (inheritance);</p>  \r<p class="indent2new indentright"><i>1 mark for each of 3 points</i></p>  \r<p class="levelms">3</p>  \r<p class="mark">[8]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">This focused on object oriented programming. A class is defined as a grouping of data structures and behaviours (methods, procedures or functions). Both data structures and behaviours are needed. Inheritance is a relationship between classes where one class shares the data structures and behaviours with its parent class. The sharing is of all data structures and behaviours, not some and not similar ones. A definition in terms of itself is not sufficient. Thus a definition of inheritance which refers to one class inheriting characteristics from its parent class was not credited.</p>  \r<p class="indent1new">The inheritance diagram was mostly accurate, although the arrows were frequently omitted, but the benefits of an object oriented program over a structured approach, in part (c), rarely gained full marks. Many candidates stated vague facts about object oriented programming, some of which also applied to a structured approach, but failed to explain how these facts were an advantage.</p></h5>', 'notes': '', 'resources': ''}, 'QW02401': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="questiona">(a)&nbsp;&nbsp;&nbsp;&nbsp; In an object-oriented, computerised encyclopaedia, there is a class called <i>Creatures</i>. Two sub-classes of Creatures are <i>Spiders </i>and <i>Beetles</i>. Draw an inheritance diagram for this.</p>  \r<p class="indent1new m-t-4 answer-toggle">&nbsp;</p>  \r<p class="mark">(2)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; For the sub-class Spiders suggest:</p>  \r<p class="indent2">(i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>one </b>property;</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2">(ii)&nbsp;&nbsp;&nbsp;&nbsp; <b>one </b>method.</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="mark">(2)</p>  \r<p class="mark">(Total 4 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1 indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; Diagram</p>  \r<p class="indent2 m-t-0"><img width=319 height=113 id="Picture 1" src="AA_COM/MW02401_files_M/image001.png">&nbsp;</p>  \r<p class="levelms">2</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; <i>1 for position, 1 for correct arrows.</i></p>\r<p class="indent2new indentright m-t-0">Circles not necessary</p>  \r<p class="indent2new indentright m-t-0">OK if completely upside down.</p>  \r<p class="indent2new indentright m-t-0">e.g. number of legs, colour, web type;</p>  \r<p class="indent2new indentright">Property Method</p>  \r<p class="indent2new indentright m-t-0">Spin web/eat;</p>  \r<p class="indent2new indentright m-t-0"><b>R</b> instance of property, e.g. 8 legs</p>  \r<p class="indent2new indentright">Does <b>NOT</b> have to be biologically correct but sensible!</p>  \r<p class="levelms">2</p>  \r<p class="mark">[4]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Too many candidates simply did not know what an inheritance diagram looked like. Those who gained full marks for this part of Question 1 placed the classes in the correct relative position and joined them by arrows pointing to the base class, <b>Creature</b>. The property of a class is comparable to a field, so ‘number of legs’ was acceptable, but ‘8 legs’ was not. For the method, acceptable answers were commands such as ‘eat’ or ‘spin web’.</p></h5>', 'notes': '', 'resources': ''}, 'QS99A305': {'question': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">A vehicle manufacturer of both cars and lorries has a computer system programmed in an object-oriented language. Three classes have been identified:</p>  \r<p class="indent1new">Vehicle</p>  \r<p class="indent1new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:28.1pt;margin-bottom:.0001pt\'>Car</p>  \r<p class="indent1new" style=\'margin-top:0cm;margin-right:28.1pt;margin-bottom: 0cm;margin-left:28.1pt;margin-bottom:.0001pt\'>Lorry</p>  \r<p class="indent1new">The classes Car and Lorry are related by single inheritance to the class Vehicle.</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(a)&nbsp;&nbsp;&nbsp;&nbsp; In object-oriented programming what is meant by:</p>  \r<p class="indent2">(i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; a class;</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="mark">(1)</p>  \r<p class="indent2">(ii)&nbsp;&nbsp;&nbsp;&nbsp; inheritance?</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="indent3new answer-toggle">______________________________________________________________</p>  \r<p class="mark">(1)</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1">(b)&nbsp;&nbsp;&nbsp;&nbsp; Draw an inheritance diagram for the given classes.</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="indent2new answer-toggle">___________________________________________________________________</p>  \r<p class="mark">(3)</p>  \r<p class="mark">(Total 5 marks)</p></h5>', 'markscheme': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">&nbsp;</p>\r<p class="indent1a indentright m-t-0">(a)&nbsp;&nbsp;&nbsp;&nbsp; (i)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A class is a set of objects which share a common structure and a common behaviour / Object type that defines a <u>data</u> <u>structure /fields /properties</u> and the <u>methods /procedures /functions</u> that act on these fields</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent2 indentright">(ii)&nbsp;&nbsp;&nbsp;&nbsp; Inheritance is a relationship among classes wherein one class shares the structure/data structure /fields /properties and behaviour/methods/procedures/functions/actions of another class</p>  \r<p class="indent3new indentright m-t-0">Or </p>  \r<p class="indent3new indentright m-t-0">Inheritance is when a class has the same characteristics as its parent class</p>  \r<p class="levelms">1</p></h5><h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="indent1 indentright">(b)&nbsp;&nbsp;&nbsp;&nbsp; </p>  \r<p class="indent2 indentright"><img src="AA_COM/MS99A305_files_M/img01.png">&nbsp;</p>  \r<p class="levelms">3</p>  \r<p class="mark">[5]</p></h5>', 'examinerreport': '<h5 class=\'contentSeparator\' style=\'page-break-inside: avoid;\'><div class=\'qnumber-hidden\'></div><p class="question">Object-oriented programming concepts were not well understood by a significant number of candidates. Few candidates could define <i>class </i>or <i>inheritance </i>correctly. In part (b) an informed guess gave many candidates two out of three marks. The third mark was lost because candidates failed to use the accepted notation for indicating the relationship between a derived class and its parent class. This notation is as follows:</p></h5>', 'notes': '', 'resources': ''}}
User: Now, the user will ask questions after this message. Use everything I gave you and the knowledge you have acquired, and from the notes you made, to answer their question in a very concise way that WILL score ALL marks. Just like the notes. For this, your answer will not have the same structure as the revision notes. Think of it as answering an exam question: short, consice, useful, scores ALL marks. Just like the exam questions provided to you, you will not leave your response in a 'notes' manner. You are just answering an exam question: which means it has to be very short unless explicitly specified by the user that it must be long and detailed. So, keep it short, concise, and only a couple of sentences that score ALL marks. Remember, it is an A-Level exam question and you will style it as such: incredibly concise sentences (essentially like bullet points but without the bullet points) that score marks. Most sentences won't even have commas, this does not mean you can't use them. Also do not repeat the question in your answer, just do it. Score all marks, assume how many marks there are based on the question if it is not provided to you. Imagine that for every sentence you make, you score a mark (for simpler questions), for high (>5 mark) questions that may differ.
In summary, you must:
* Answer very concisely. Kind of like bullet points but as a short para. Most of the time, a sentence, or point, will be a mark.
* Do not repeat the question at the start.
* Don't over-do your answer. Please. 1 mark (e.g., usually, 'What' questions) is like one very short sentence usually. Remember the summary from the notes? Your answer will essentially be like that for most questions but a bit (a bit!) more developed. Remember, this is just A-Levels. Use some of the exam questions that I provided as an example of how you should model your answers.
* When you're listing examples, don't list every example in the universe.
* Score all marks. Be helpful.
User: Write the notes you made
Assistant: Object-Oriented Programming Concepts** (Spec Points: 3.1.2.1 Programming paradigms, 3.1.2.3 Object-oriented programming)

**Learning Objectives**
- Understand key principles of OOP: encapsulation, inheritance, instantiation, polymorphism, abstraction, and overriding.
- Recognize that OOP consists of classes and objects, where classes serve as blueprints for objects that hold properties and methods.
- Learn to create class diagrams.

**Introduction**
Object-oriented programming (OOP) is an extension of structured programming. Unlike procedural programming, which separates data and code, OOP encapsulates both in single units known as objects. This approach simplifies data management and reduces programming errors by limiting direct access to object data.

**Key Concepts**
- **Encapsulation**: Combines data (properties) and methods in an object, hiding details and reducing side effects.
- **Class**: A blueprint defining properties and methods; does not hold data.
- **Object**: An instance of a class, containing specific data and able to execute defined methods.
- **Inheritance**: Subclasses inherit properties and methods from superclasses, promoting reuse of code. For example, `Mortgage` and `Current` can extend an `Account` superclass.
- **Polymorphism**: Enables methods to be reused in subclasses with different implementations, allowing the same method to execute differently based on the object's class.

**Class Diagrams**
Class diagrams visually represent classes, their properties, and relationships using boxes and arrows. 
- Class names are at the top, followed by properties and methods.
- Relationships are shown with arrows indicating inheritance.

**Design Principles**
- **Encapsulate what varies**: Create distinct classes for varying functionalities.
- **Favour composition over inheritance**: Use aggregation to create complex types from simpler ones instead of relying solely on inheritance.
- **Program to interfaces, not implementation**: Define methods in interfaces, allowing flexibility in their implementation within classes.

**Exam Questions and Answers**
1. **Q21L1C09P3**: What is polymorphism? 
   - A method shared across subclasses responds differently depending on each subclass's implementation. This allows various objects to be treated similarly while executing their specific logic.
  
2. **Q22L1C06**: Explain the difference between public and protected attribute specifiers.
   - Public attributes can be accessed from any class. Protected attributes are accessible only within the class they’re declared in and its subclasses.

3. **QW08404**: State two advantages of object-oriented programming over structured programming.
   - OOP allows for reusable code through inheritance, and it encapsulates data ensuring controlled access which leads to fewer errors.

**Summary**
Object-oriented programming organizes code into classes and objects, encapsulating data and methods to promote reusability and simplicity. Key concepts like inheritance and polymorphism enhance code efficiency and flexibility, and understanding these principles is essential for effective programming.

{
"chapter": 6,
"page": 30,
"chapter_name": "Object-oriented Programming",
"topics": [
"Object-oriented programming concepts",
"Specification coverage",
"Key programming paradigms",
"Class diagrams",
"OOP design principles",
"OOP programming benefits"
]
}
User: Give me ALL the questions I sent you
Assistant: