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

Computer Science

100 marks · 3 hours · 7 questions
This paper Computer Science · all yearsQ. 2 · Write a program to input…Q. 3 · Define a function named monthly-profit…Q. 4 · Define a structure to store…Q. 5 · Describe the followings (no description…Q. 6 · Write Abstract Data Types (ADT)…Q. 7 · Draw a diagram that illustrates…Q. 8 · What are the purposes of…With this paper← 20152017 →
3 hours · questions hide until you reveal them

Not yet checked 1 of 7 questions have not yet been compared with the official paper.

Section I

Q. 2
  1. (a)Write a program to input choice from user for temperature conversion from Fahrenheit to Celsius or Celsius to Fahrenheit. After the choice, input temperature from user and display the converted answer. Sample execution of the program is given below; 1. Fahrenheit to Celsius 2. Celsius to Fahrenheit Enter your choice: 1 Enter Temperature in Fahrenheit: 98 Same Temperature in Celsius: 36.7 Press Any Key to Continue.... [6]
  2. (b)Which type of computer (supercomputers, mainframe computers, minicomputers, microcomputers) will suit an individual? Justify your answer. [6]
  3. (c)Suppose you are trying to build a Student Registration System using object oriented approach. Objective of the system is to store information of course registration of students and their course results. In C++ syntax define following classes with suitable attributes each having getdata() and showdata( ) member functions along with suitable constructor functions; Person, Teacher, Student, Course, Section, Allocation (containing information about allocation of a course to a teacher in a semester), Registration (containing information about registration of a student in course, this class will also save course result information of the student). You can add more classes which you think suitable for the system. [8]
(20)
Q. 3
  1. (a)Define a function named monthly-profit which will calculate the monthly profit on the given investment amount. Function will take two float arguments, percent profit rate and investment amount and return the monthly profit (float). Write function prototype, function definition and a main program to demonstrate the functionality. Sample execution of the program is given below. Note that monthly profit 4000 has been calculated by the function by doing (8/100) * 50000. User can enter any values therefore write generalized function (user variables, not given values). Enter percent profit rate: 8 Enter investment amount: 50000 Monthly profit: 4000 Press Any Key to Continue.... [6]
  2. (b)Explain and differentiate between volatile and non-volatile memory, giving examples. [6]
  3. (c)Suppose you are trying to build a Library Information System using object oriented approach. System should be able to keep track of books issued and returned. It should be able to calculate fine if a book is late. Currently you are required to design classes i.e. not to write C++ code but describe which class you will define, which data members you will add, which member functions you will include in those classes. Define only suitable classes and suitable attributes (data members) in C++ syntax. Names of some classes are like, Student, Teacher, Book, Issue Book etc. You can (but not required to) extend this list of four classes if you think of some other suitable classes. [8]
(20)
Q. 4
  1. (a)Define a structure to store records of Persons. We want to store only Name, age and address of Person. Write main program to input record of one person and display 'Young' if its age is less than 20 or 'Old' if the age is greater than 50 and 'Middle' if the age of person is between 21 and 49. Sample execution of the main program is given below: Enter Name = Kashif Enter Age = 19 Enter Address = H 120, St: 08, KAR. Person is YOUNG Press Any Key to Continue [6]
  2. (b)Convert given binary numbers to Decimal, Octal and Hexadecimal. 100( 2 ) 10100( 2 ) 100101( 2 ) [6]
  3. (c)Suppose you are designing software for a Medical Store, using object oriented techniques. Decide and define classes (like 'Person', 'Customer', 'Salesman', 'Purchase’ etc.) and their attributes in C++ or Java syntax. You are not required to write any member functions and main programme. You must use inheritance where suitable. [8]
(20)

Section II

Q. 5

Describe the followings (no description with more than three lines);

  1. (i)Sibling Nodes [1]
  2. (ii)Degree of a tree [1]
  3. (iii)Leaf Node [1]
  4. (iv)Height/ Depth of a tree [1]
  5. (v)Binary Tree [1]
  6. (vi)Full Binary Tree [1]
  7. (vii)Complete Binary Tree [1]
  8. (viii)Maximum number of nodes in a Binary Tree at level L. [1]
(8)
Q. 6
  1. (a)Write Abstract Data Types (ADT) of Stack and Queue. Include the specifications of Add, Delete, IsEmpty, IsFull functions along with their respective functions. [6]
  2. (b)For step count expressions n 2 + 10 and 2 n / 4 find breakeven point i.e. for which value of n (starting from 1,2...) second expression will become greater than value of first expression. [6]
  3. (c)In AVL tree balance factor of every node is -1 or 0 or +1. We can calculate the balance factor as Height left-sub-tree - Height right-sub-tree. Construct AVL tree from the given data; A = {8, 14, 2, 26, 10, 12, 16, 28, 20, 7} [8]
Not yet checked
(20)
Q. 7
  1. (a)Draw a diagram that illustrates the process of translating a C++ source file into an executable file. Give example of each phase depicted in your diagram of compilation process. [5]
  2. (b)Compare and contrast among compiler, interpreter and assembler. [5]
  3. (c)Describe Software Development Life Cycle (SDLC). Explain your answer with the help of depicting and describing different phases of pure water fall software life cycle. [5]
  4. (d)What is the difference between SRS document and design document? What are the contents we should contain in the SRS document and design document. [5]
(20)
Q. 8
  1. (a)What are the purposes of Data Flow diagrams, Entity-Relationship diagrams? Give an example diagram of each. [5]
  2. (b)Explain five properties of language using the example of English. Explain why a software language like MiniJava meets these properties as well. [5]
  3. (c)Lexical analysis: Consider the following regular expression r 1 = (A | .... | Z) (0 | .... | 9) Describe the language defined by r 1 in English. Turn r 1 into an equivalent finite automaton. Remove ε-moves from the finite automation. [5]
  4. (d)What do you mean by Context Free Grammar (CFG)? Illustrate your answer with examples. [5]
(20)

Related papers

About this paper

The 2016 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.