Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started