Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the definition of the following class: (1, 2, 3, 5, 7) class productType //Line 1 //Line 2 //Line 3 //Line 4 //Line 5 productType

image text in transcribed

Consider the definition of the following class: (1, 2, 3, 5, 7) class productType //Line 1 //Line 2 //Line 3 //Line 4 //Line 5 productType (string, int, double, double) //Line 6 public: productType ): productType (int, double, double) productType (string, string, string int, double, double); //Line 7 void set (string, string, string, int, //Line 8 //Line 9 double, double); void print) const void setQuantitiesInStock (int x); void updateQuantitiesInStock (int x); int getQuantitiesInStock () const //Line 10 //Line 11 //Line 12 void setPrice (double x) double getPrice ) const; void setDiscount (double d); double getDiscount ) const; //Line 13 //Line 14 //Line 15 //Line 16 //Line 17 //Line 18 //Line 19 //Line 20 //Line 21 //Line 22 //Line 23 //Line 24 private: string productName; string id; string manufacturer; int quantitiesInStock; double price; double discount; di Give the line number containing the constructor that is executed in each of the following declarations. a. i. productType productl; ii. productType product2 ("Microwave", "M3562", "GeneralPool", 35, 175.00, 0.1); ii. productType product3 ("D1290", 25, 375.00, 0.05) iv. productType product4 (10, 8.50, 0.2); Write the definition of the constructor in Line 4 so that the instance variables are initialized to "", " ", "", o, 0.0, and o.o, respectively. b

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

What is the best conclusion for Xbar Chart? UCL A X B C B A LCL

Answered: 1 week ago