6. Consider the following declarations: (1, 2, 5, 7) class bagType public: void set (string, double,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
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 the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
if you have 2000 boxes of radioactive parent element Repeatium that has a half life 36,000 years long, how long will it take for this amount to be reduced by half to 1,000 boxes ?
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Create a General Journal entry in accordance with GAPP and using the periodic inventory system and the net method, Dec 4: Returned defective inventory with a gross cost of $5,000 back to the vendor,...
-
a. Consider the effect of population growth on the allocation on the dynamic efficient allocation of a depletable resource across time. Suppose we have two versions of the two-period model, discussed...
-
Show that the sequence defined by a1 = 1, an+1 = 3 1/an is increasing and an < 3 for all a. Deduce that {an} is convergent and find its limit.
-
When you think of "kindergarten," do you think of it as a garden of children? In 1837 German educator Friedrich Froebel developed and tested new educational methods and philosophies based on young...
-
Check whether the following can define probability distributions and explain your answers. (a) \(f(x)=\frac{1}{4}\) for \(x=10,11,12,13\) (b) \(f(x)=\frac{2 x}{5}\) for \(x=0,1,2,3,4,5\) (c)...
-
Suppose a ten-year, $1000 bond with an 8% coupon rate and semiannual coupons is trading for a price of $1034.74. a. What is the bonds yield to maturity (expressed as an APR with semiannual...
-
1. "Businesses are feeling the impact of the war in Ukraine. Risk managers update their risk profiles due to supply chain disruptions, economic sanctions, and even displaced workforce. These issues...
-
If an amino acid is found at the exact same location in the alignment of two homologous proteins, that amino acid is said to be "absolutely conserved." An amino acid type can also be conserved at a...
-
Which statement is NOT true about credit scoring system? O a. Credit scoring systems enable creditors to evaluate millions of applicants consistently and impartially on many different...
-
You are making a sales presentation and brought a few examples of the product you are selling to share with the audience. You wonder whether there is any advantage to having images of the product in...
-
What words or phrases trigger a negative emotional response from you? If someone repeatedly uses one of your trigger words, what are your options for responding? Which option would you choose?
-
If you were granting a customer a refund for a faulty product, why might you also include a discount for a future purchase? The customer is getting what she asked for, so why do more?
-
How can social media affect customer relationships?
-
Some research suggests that emotional intelligence is a stronger predictor of job success than traditional intelligencehow smart you are. Why do you think emotional intelligence is so important for...
-
A blog that should make use of headings, sub-sections, columns and appropriate business-related images and illustrations. This format offers the opportunity to present academic and theoretical...
-
What mass of H2 will be produced when 122 g of Zn are reacted? Zn(s) + 2HCl(aq) ( ZnCl2(aq) + H2(g)
-
Why does typing a number such as 121 as input require a program to make a conversion?
-
Consider the TooBig functor in Listing 16.15.What does the following code do, and what values get assigned to bo? bool bo = TooBig(10)(15); One functor (f100) is a declared object, and the second...
-
Do Programming Exercise 5 but use a two-dimensional array to store input for 3 years of monthly sales. Report the total sales for each individual year and for the combined years.
-
solve the given problem using PSO method \[f(X)=1200\left(2 x_{1} x_{3}+2 x_{2} x_{3} ight)+2500 x_{1} x_{2}+500\left(\frac{1000}{x_{1} x_{2} x_{3}} ight)+100\left(\frac{1000}{10 x_{1} x_{2} x_{3}}...
-
Show 3 iterations for solving the problem below \[\min f(X)=-12 x_{1}-7 x_{2}+x_{2}^{2}\] subject to $-2 x_{1}^{4}-x_{2}+2=0$ \[0 \leq x_{1} \leq 3,0 \leq x_{2} \leq 3\]
-
Solve the optimization problem using SA \[\min f(X)=100\left(x_{1}^{2}+x_{2} ight)^{2}+\left(1-x_{1} ight)^{2}\] subject to $X \in[0,7]$
Study smarter with the SolutionInn App