Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote