Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. Consider the following declarations: (1, 2, 5, 7) class bagType public: void set (string, double, double, double, double); void print () const; string

6. Consider the following declarations: (1, 2, 5, 7) class bagType public: void set (string, double, double,

6. Consider the following declarations: (1, 2, 5, 7) class bagType public: void set (string, double, double, double, double); void print () const; string getStyle() const; double getPrice () const; void get (double, double, double, double); bagType(); bagType (string, double, double, double, double); private: string style; double 1; double w; }; a. bagType newBag; //variable declaration How many members does class bagType have? How many private members does class bagType have? How many constructors does class bagType have? 0. d. How many constant functions does class bagType have? e. Which constructor is used to initialize the object newBag? b. a. b. C. d. double h; double price; 0. Write the definition of the member function set so that private members are set according to the parameters. the Write the definition of the member function print that prints values of the data members. Write the definition of the default constructor of the class bagtype that the private member variables are initialized to "". 0.0.0.0, 0.0. 0.0, respectively. Write a C++ statement that prints the value of the object newBag Write a C++ statement that declares the object tempBag of type bagType, and initializes the member variables of tempBag to "backPack", 15, 8, 20, and 49.99, respectively.

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

a Class bagType has 9 members 5 public member functions set print getStyle getPrice and get 4 private member variables style l w h and price b How man... 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

C++ Primer Plus

Authors: Stephen Prata

6th Edition

978-0321776402, 0321776402

More Books

Students also viewed these Programming questions