need it in an hour

profilestudent1997
oop.pdf

Page 1 of 4

ANSWER QUESTION 1 AND ANY OTHER FOUR

QUESTION ONE (14 MARKS) compulsory

a. Discuss the features of object oriented programming languages.

[5 marks]

b. A perfect square is a number that can be expressed as the product of two

equal integers. Draw a flowchart, and write a corresponding class oriented

program to check if any entered number is a perfect square integer number.

[6 marks]

c. The world is experiencing paradigm shift from structured programming

approach to object oriented programming approach. Explain the reasons that

justify this scenario.

[3 marks]

QUESTION TWO (14 MARKS)

a. Explain the relationship between C and C++ programming.

[2 marks]

b. A class is required to determine the number of bytes for each data type

entered into the program. Write a class oriented program that displays the

corresponding bytes for each data type in the program.

[6 marks]

QUESTION THREE (14 MARKS)

a. Explain how reusability is achieved in object oriented programming. [2

marks]

Page 2 of 4

b. By use of an example, explain how single inheritance can be achieved in the

program

[6 marks]

c. How is pass by reference implemented in the program. Write a function

oriented program to compute the compound interest for the sum invested for

any number of years using the concept of pass by value.

[6 marks]

QUESTION FOUR (14 MARKS)

a. How are control structures important in program development? Explain

[2 marks]

b. goto control structure is not widely used in programming. Justify the

statement. [2 marks]

c. With the help of syntax and a flowchart, explain the switch case control

structure.

[5 marks]

i. Switch case control structure

d. Using the do … while loop control structure, write a class oriented program

to find the sum of the digits of any input integer number.

[5 marks]

QUESTION FIVE (14 MARKS)

a. Discuss the importance of arrays in a program.

[2 marks]

.

Page 3 of 4

b. With the help of syntax, explain how arrays are initialized outside the class.

[3 marks]

c. Write a class oriented program to display an identity matrix of order 3.

[6 marks]

d. Discuss any three rules for overloading operators in a program. [3 marks]

.

QUESTION SIX (14 MARKS)

a. With the help of an example, discuss how user defined data types are

initialized in object oriented programming.

[5 marks]

b. Write short notes on the following types of constructors:

[3 marks]

i. Parameterized constructors

ii. Default constructors

c. How is an exception handled in C++? Explain by use of the syntax and an

example of class oriented program.

[6 marks]

QUESTION SEVEN (14 MARKS)

a. Write a menu driven program that performs the following:

[14 marks]

Page 4 of 4

i. Checks if any entered number is a palindrome number

ii. Checks if any entered number is an Armstrong number

iii. Checks if any entered number is a prime number.