c++ Consider the following declarations and answer the 4 questions below: class
ID: 3779216 • Letter: C
Question
c++
Consider the following declarations and answer the 4 questions below:
class bagType
{
public:
void set(string, double, double, double, double);
void print() const;
string getStype() const;
double getPrice() const;
void get(double, double, double, double);
bagType();
bagType(string, double, double, double, double);
private:
string style;
double l;
double w;
double h;
double price;
};
bagType newBag; // variable declaration
How many members does class bagType have?
How many private memebers does class bagType have?
How many constructors does class bagType have?
Which constructor is used to initialize the object newBag?
c++
Consider the following declarations and answer the 4 questions below:
class bagType
{
public:
void set(string, double, double, double, double);
void print() const;
string getStype() const;
double getPrice() const;
void get(double, double, double, double);
bagType();
bagType(string, double, double, double, double);
private:
string style;
double l;
double w;
double h;
double price;
};
bagType newBag; // variable declaration
How many members does class bagType have?
How many private memebers does class bagType have?
How many constructors does class bagType have?
Which constructor is used to initialize the object newBag?
Explanation / Answer
Answers:
How many members does class bagType have?
Answer: 6
string style;
double l;
double w;
double h;
double price;
and bagType newBag;
How many private memebers does class bagType have?
Answer: 5
string style;
double l;
double w;
double h;
double price;
How many constructors does class bagType have?
Answer: 2
bagType();
bagType(string, double, double, double, double);
Which constructor is used to initialize the object newBag?
Answer: bagType();
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.