Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2. You need to subtract two identical cube objects of varying length, breadth, height and weight to create a new cube. Create a class

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 2. You need to subtract two identical cube objects of varying length, breadth, height and weight to create a new cube. Create a class of cube'Type and implement a function to return the newly created cube. The function call by the client would use which constructor. Also implement that particular constructor type (Marks 10) uestion 3. Complete the implementation of the following class and create objects one having 2 dollar bills, 42 quarters and 10 cents while other having 12 dollar bills, 2 quarters and 10 cents. Print the values of each and compare to print if the values are equal (Marks 10) class PiggyBank! private: int dollarBills; int noofQuarters; int noOfPennies; public: PiggyBank(int dollarBills 0, int nofofQuarters 0; int noOfPennies 0): Directions: All questions to be answered. Write code in the best possible syntax. If more space is required use back side of a page stating the question number. Do not use any electronic medium as support for examination. Question 1: Complete the code of the following functions including main0 (Marks 10) struct carwheel f double tirePressure[4]; int mainot carwheel car[ 15]: //write the pressure of 15 car objects /loutput the 15 car object pressures using the returnPressure function void write(carwheel c[], int sizc) carwheel returnPressure(carwheel c) //returns tire pressure increased by 10 psi Question 4. In the following classes class Pointl private: int x; int y; public: Pointl (int -0, int-0); class Point2 private: int x; int y public: Point2(int- 6, int-9); bool equalPoint(Pointl&)const; void printOconst; Implement all the functions and add more functions in the class definitions as required? Question 5: Create a class which inputs a 3X3 matrix of integers and output a matrix which is a difference of two such matrices. Create appropriate constructor to initialize the values of the matrices (Marks 10) Question 6: A point class has the following definition class Point private: int x; int y: public: Point (int, int): A vector class has two points as start point(x,y) and end point(x.y). Write the header file and implementation file of the Vector class containing constructor, other functions, and also a function returning length of Vector determined from start point and end point coordinates. Write also the client code. (Marks 10) Question 7: In the following class class Setf private: int x; static int y[5]; public: static int z[3]; Set(); void print )const; Implement all the functions, initialize all the variables. The user is going to set new values of array z13] and all the variable to be printed by print0. (Marks 10)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Create a workflow analysis.

Answered: 1 week ago