Prep Right
Questions › CSS › Computer Science › 2018
FPSC · CSS 2018

Computer Science, Paper I

100 marks · 3 hours · 1 questions
This paper Computer Science · all yearsQ. 4 · Consider the inheritance hierarchy shown…With this paper← 20172018 →
3 hours · questions hide until you reveal them

Section I

Q. 4

Consider the inheritance hierarchy shown below. Each part of this question is independent.

  1. (a)In which class(es) would it make most sense to have protected members? Which class(es) would be able to access those protected members directly? [5]
  2. (b)Which class(es) can access private members of class C directly? [5]
  3. (c)Suppose class C contains a pure virtual function. Suppose we wish to instantiate objects of this hierarchy. Which class(es) are or could be abstract and which are concrete? [5]
  4. (d)Consider the following list of classes: Car, SteeringWheel, Vehicle, Van, Minivan, AudioSystem, ParkingLot. Your task is to describe all of the is-a and has-a relationships between these classes. Include an inheritance hierarchy for all classes that fit. Fill in the table with is-a or has-a relationship while leaving the cells empty where no relation is applicable. Vehicle Car Van Mini Van Steering Wheel Audio System Parking Lot Vehicle Car is-a Van is-a Mini Van is-a Steering Wheel Audio System Parking Lot [5]

Related papers

Computer Science 2000Computer Science 2002Computer Science 2003Computer Science 2004Computer Science 2005Computer Science 2006Computer Science 2009Computer Science 2010Computer Science 2011Computer Science 2012Computer Science 2013Computer Science 2015Computer Science 2016Computer Science 2017Computer Science 2018Computer Science 2019Computer Science 2019Computer Science 2020Computer Science 2020Computer Science 2021Computer Science 2021Computer Science 2022Computer Science 2022Computer Science 2023Computer Science 2023Computer Science 2024Computer Science 2024Computer Science 2025Computer Science 2025Computer Science 2026Computer Science 2026Accountancy & Auditing 2018Accountancy & Auditing 2018Agriculture & Forestry 2018Anthropology 2018Applied Mathematics 2018Arabic 2018Balochi 2018Botany 2018British History 2018Business Administration 2018Chemistry 2018Comparative Study of Major Religions 2018Computer Science 2018Criminology 2018Current Affairs 2018English Essay 2018English (Précis & Composition) 2018Environmental Sciences 2018European History 2018General Science & Ability 2018Geography 2018Geology 2018Governance & Public Policies 2018History of Pakistan & India 2018International Relations 2018Islamic History & Culture 2018Islamic Studies 2018Journalism & Mass Communication 2018Law 2018Mercantile Law 2018Muslim Law & Jurisprudence 2018Pakistan Affairs 2018Philosophy 2018Physics 2018Physics 2018Political Science 2018Psychology 2018Punjabi 2018Pure Mathematics 2018Statistics 2018Town Planning & Urban Management 2018Urdu Literature 2018Zoology 2018

About this paper

The 2018 CSS Computer Science paper set by the FPSC. Question wording only; questions marked “Not yet checked” have not been compared with the official paper yet.

Disclaimer Prep Right is independent and not affiliated with FPSC.