Question Paper for Object Orient Programming Using C++ of BCA 3rd Semester of PTU

Paper ID [A0214]
(Please fill this Paper ID in OMR Sheet)
BCA (304)(S05/Old) (Sem. - 3rd)
OBJECT ORIENT PROGRAMMING USING C++


Time : 03 Hours
Maximum Marks : 75

Instruction to Candidates:

1) Section -A is Compulsory.
2) Attempt any Nine questions from Section - B.

Section - A (15 × 2 = 30)

Q1)

a) What do you mean by library files?

b) What is #include directive?

c) Explain the for loop.

d) What is breakh statement?

e) How pointers are defined?

f) How objects are defined for a class?

g) What are constructors?

h) What is the purpose of class specifiers(declaration)?

i) Explain inheritance.

j) Explain the operator keyword.

k) What are pointer variables?

l) What is putline() function?

m) Explain iostream class.

n) Describe open() function.

o) Tell what this statement defies: employee emplist[1000];

Section - B (9 × 5 = 45)

Q2) What are the various loop control statements in C++? Explain briefly.

Q3) Give Various Basic C++ Data types with their keywords and details.

Q4) Assume you want to generate a table of Arithmetic progressive series(AP) of any given number. Write a program that allows the user to enter the number and then generates the table, formatting it into ten columns and 5 lines.

Q5) A Point on the 2-D plane can be represented by two numbers: an X-coordinate and Y-Coordinate. For example, (2, 3) represents a point 2 units to the right of the origin along the x-axis and 3-units up the y-axis. The product of the two points can be defined as new point whose x-coordinate is the product of the X-coordinate of the two points, and whose y-coordinate is the product of their y-coordinates. Write a program that uses a structure called point to model a point. Define three points, and have the user input values to two of them. Then set the third point equal to the product of the other two, and display the value of the new point.

Q6) Define pointers. How the arguments are passed in a function using pointers.

Q7) Differentiate between private and protected class. Elaborate with suitable example.

Q8) Create a Class that imitates part of the functionality of the basic data type int. Call the class Int. the only data in this class is an int variable Include member function to initialize Int to 0, to initialize it to an int value, to display it, and to add two Int values. Write a program that exercise this class by creating two initialized and one uninitialized Int values adding these two initialized values and placing the response in the uninitialized value and then displaying this result.

Q9) Imagine a publishing Company that markets both books and audiocassettes version of its works. Create a Class publication that stores the title and price of a publication. From this class drive two classes: book, which adds a page count; and tape, which adds a playing time in minutes. Each of these three classes should have a getdata() function to get its data from the user at the keyboard and a putdata() function to display its data. Write a main () program that creates an array of pointers to publication.

Q10)
Write a program that returns the size in bytes of a program entered on the command line: C:/>filesize program 1.text

Q11) Explain the following:

(a) Open() function
(b) Redirection

Q12) Write simple program to read some lines of the file named "text1.text".

Q13) Explain the following functions

(a) seekp()
(b) getdata()
(c) putdata()
(d) tellp()

Post a Comment

Previous Post Next Post