Question: NOTE : Each question is 5 marks. Q 1: Create a class called (Rectangle) and an object of this class called (rect). This class contains

NOTE : Each question is 5 marks. Q 1: Create a class called (Rectangle) and an object of this class called (rect). This class contains two data members of type integer ( width and height ) with private access and two member functions with public access: set_values() and area(). Write a program to set and display the object fields. Q 2: Answer ONE of the following ? A:/Write a program using functions (addition and cube) to calculate the equation : Z= addition( x,y) + cube(x). Then, print the final result of Z ? B:/ Class called ( myclass ) and an objects of this class called (objl) and (obj2). This class contains two data members of type integer ( a and b) with private access, and three member functions with public access: constructor to give value to variables ,and default constructor and show() to display variables. Write a program to set and display the objects fields
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
