0% found this document useful (0 votes)
8 views

Time Allowed: Three Hours 15 June, 2016, 9am-12 Noon: Instructions To Candidates

This document provides instructions and questions for an examination on Object Oriented Programming with C++. It is a closed book exam worth a total of 100 marks and accounting for 40% of the course assessments. The exam is 3 hours and contains 5 questions covering topics like encapsulation, inheritance, polymorphism, file handling, and coding examples using classes. Students are instructed to answer all questions and additional materials are not permitted.

Uploaded by

Har
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Time Allowed: Three Hours 15 June, 2016, 9am-12 Noon: Instructions To Candidates

This document provides instructions and questions for an examination on Object Oriented Programming with C++. It is a closed book exam worth a total of 100 marks and accounting for 40% of the course assessments. The exam is 3 hours and contains 5 questions covering topics like encapsulation, inheritance, polymorphism, file handling, and coding examples using classes. Students are instructed to answer all questions and additional materials are not permitted.

Uploaded by

Har
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

NATIONAL INSTITUTE OF BUSINESS MANAGEMENT

Diploma in Computer System Design-15.3/Software Engineering-15.2/Computer Networks – 15.1

Object Oriented Programming with C++- DCSD 107

Time allowed: Three hours 15th June, 2016, 9am-12 noon


INSTRUCTIONS TO CANDIDATES

 This paper contains 5 questions on 3 pages (2-3).


 The total marks obtainable for this examination is 100.
 Marks for each question are indicated
 This examination accounts 40% for the course assessments.
 This is a closed book examination.
 All calculators are not allowed.
 Answer ALL questions.

ADDITIONAL MATERIALS

 None

Page 1 of 3
1.
a. Briefly explain features Encapsulation, inheritance and Polymorphism in OOP. (03 Marks)
b. Write C++ codes to define a class called Abc with a friend function, cd() which access
private property x in class Abc. (05 Marks)
c. A Company which is selling three types of products receives orders from customers to
purchase them. Each order has order number and order total value. There are three
functions associated with an order to perform following tasks. An order may contain
different types of several products.
Function 1: set order number of an item
Function 2: get unit price and quantity purchased from each item type and find the
total value.
Function 3: display the total value of an order with order number.
Write an object oriented program to find and display total value of one orders received by
the company. (12 Marks)

2.
a. List out three features of Destructor. (03Marks)
b. Write C++ codes to define a copy constructor to assign value for property h in class Xyz
object to another object. (05 Marks)
c. Several teachers teach in a private school. Each teacher has teacher number, teacher
name and number of years taught. Use constructor to assign data for teacher number,
teacher name and number of years taught of a teacher. The function display() displays
values of teacher number, teacher name and number of years taught.
Write an object oriented program to assign and display values of two teachers in the
school. (12 Marks)

3.
a. What is Multiple Inheritance. Briefly explain with a diagram. (03 Marks)
b. Write C++ codes to initialize property a in super class Pq and b in class Xy using
constructors. (05 Marks)
c. An organization has several employees working on different projects. Each employee has
employee number and employee name. The number and name of an employee is assigned
by function setEmployee().This organization has permanent employees and they have
basic salary and epf rate. Basic salary and epf rate of a permanent employee is set by
function setPermenent().in addition to that monthly epf amount of a permanent
employee is calculated by function findEpfAmount().Data of each class are not allowed to
be acceded by outside members of the class except derived classes.
Write an object oriented program to set details (number, name, basic salary, epf rate) and
display monthly epf amount of one permanent employee with employee number in the
organization using given functions. Assume permanent employee can inherit employee.
Info: epf amount = basic salary * epf (12 Marks)

Page 32 of 3
4.
a. What is Run Time Polymorphism (03 Marks)
b. Write C++ codes to overload function wq() to multiply two numbers and add three
numbers sequentially in class Jkl. (05 Marks)
c. A shop is selling different items for their customers. The virtual function getValue() which
finds total value of an item in the stock. This function getValue() is used by Luxury Item
to find total value of a luxury item. Total value of a luxury item is calculated after applying
tax. Tax is applied only for luxury items. Assume Tax amount is 2% from Luxury Item price.
Write an object oriented program to find and display total value of one Luxury Item.
Info: Total value of an item=unit price * quantity available
Total value of an Luxury Item= (unit price * quantity available) +Tax amount
(12 Marks)

5.
a. Briefly explain importance of File handling. (03 Marks)
b. Write C++ codes to get the current location of get pointer and output pointer in a file “pst”
and display them. (05 Marks)

c. An institute has planned to record number, name and email address of each student in a
text file and display records which read. You are required to write object oriented program
to write student details mentioned above to a file called “student” and display first 10
students recorded in the file after reading. Use two functions to handle write and read
operations separately. (12 Marks)

Page 3 of 3

You might also like