Question: 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, 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
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... View full answer
Get step-by-step solutions from verified subject matter experts
