0% found this document useful (0 votes)
61 views2 pages

Assignment 4

The document outlines an assignment for a CPP course consisting of three questions. Q1 requires the creation of a Chair class with specific data members and member functions, including a static SetPrice function. Q2 involves implementing a stack class using an array with various functions, and Q3 focuses on dynamic memory allocation for one-dimensional and two-dimensional arrays.

Uploaded by

Arohi Patile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views2 pages

Assignment 4

The document outlines an assignment for a CPP course consisting of three questions. Q1 requires the creation of a Chair class with specific data members and member functions, including a static SetPrice function. Q2 involves implementing a stack class using an array with various functions, and Q3 focuses on dynamic memory allocation for one-dimensional and two-dimensional arrays.

Uploaded by

Arohi Patile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CPP - Assignment 4

Q1.
Create class Chair having following members.

data members:
int height
int weight
double price;
Color color (use enum for color)

member functions
parameterless Constructor
parameterized constructor
Input function
Display function
SetPrice function(static)
Destructor

Note: price must be shared by all the objects.

Q2.
Write a class stack. Implement stack using
array. Provide functions push,pop, isfull, isempty.
In main create the objectof stack and invoke its
method in menu driven way.

August 2024– January 2025 1


CPP - Assignment 4

Q3.
Alloctate memory dynamically for one
dimensional and two dimensional array by using
new operator

August 2024– January 2025 2

You might also like