Explaining characteristics of object-oriented languages


Question 1) What do you mean by object-oriented approach? What are the major characteristics of object-oriented languages?

(b) Write down the essential feature of C++ language?

Question 2)(a) Use for loops to construct a program which displays diamond shape of asterisks (+) on the screen. The diamond must look like shown here, except that it must be 9 lines high, instead of 5 lines. One way to do this is to nest two inner loops, one to print spaces and one to print asterisks (+), inside the outer loop that steps down the screen from line to line.

    +
  +++     
++++
  +++
    +

(b) Describe the following terms: Inheritance, Polymorphism and Overloading with the help of suitable examples.

Question 3)(a) Write a function which takes three distance values as arguments and returns smallest one. Include a main ( ) program which accepts three distance values from the user, compares them, and displays the smaller.

(b) What is the principle reason for passing arguments to a function by reference? In what unusual place can you use a function call when a function returns a value by reference?

Question 4) Write a program which reads group of numbers from the user and places them in the array of type float. Once the numbers are stored in the array, the program must compute the average of the input numbers, detemrine the smallest and the largest number from the group of input numbers and print the result for all calculations. Use pointer notation wherever possible.

Question 5) Write a detailed note on the following topics:

• Pointers

• Reusability

• Constructors

• Advantages of OOP

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Explaining characteristics of object-oriented languages
Reference No:- TGS06020

Expected delivery within 24 Hours