1. Print the sum, average and product of 5 numbers by creating a class with separate functions for each operation. (5)
2. Calculate the area of a trapezoid and display it using the constructor that takes parameters. (5)
3. Define a base class area_cl, which has member variables height and width. Create two derived classes called rectangle and isosceles that inherit area_cl. Have each class include a function called area() that returns the area of a rectangle or isosceles triangle as appropriate. (6)
4. Write a program that finds the maximum value in an array of elements. Do it with the help of returning objects from functions. (5)
5. Write a program to calculate the average height of all the students of a class. The number of students and their heights are taken as input by the user. Use array of object concept to implement this task. (5)
6. Take a two dimensional array of object as input and display the array by reversing the rows by using pointers to object. (5) Hint: Input: 1 2 Output: 2 1 34 43 56 65
7. Write a function called nego that reverses the sign of its integer parameter. Write the function in two ways – first by using a pointer parameter and then by using a reference parameter. Include a short program to demonstrate their operation. (7)
8. Define two classes car and truck each containing a private member variable speed. Find out whose speed is greater where one function is a member to a class and a friend of another. (7)
Any citation style (APA, MLA, Chicago/Turabian, Harvard)
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.