Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Consider the definition of the following class: (1,2,3, 5,7 clasa productTyp publie productType O productType(int. double, double) productType (atring, int, double, double)s //tine6 productType
C++ Consider the definition of the following class: (1,2,3, 5,7 clasa productTyp publie productType O productType(int. double, double) productType (atring, int, double, double)s //tine6 productType (atring. atring.atring //Line1 /Line 2 /Line 3 //Line /Line s int, double, double) //Line 7 void set (atring, atring, string. int void print) const double, double) i //Line //tine 9 void setQuantitiesInstock (int x) void updateQuantitiesinstock (int x) int getQuantitiesInstock) const //Line 10 //Line 11 //Line 12 void #etPrice (double x); double getPrice) consti //Line 13 //Line 14 void setDiscount (double d) i double getDiscount) consti //Line 15 //Line 16 private: //Line 17 string productName string id string manufacturer: int quantitiesInstock: double price double discount //Line 18 //Line 19 //Line 20 //Line 21 //Line 22 //Line 23 //Line 24 a. Give the line number containing the constructor that is executed in each of the following declarations. i. productType producti; li productType product2 ("Microwave", "M3562, GeneralPool", 35, 175.00, 0.1) ili. 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 to0, o.o, and o.o, respectively b. c Write the definition of the constructor in Line 5 so that the string instance variables are initialized to , and the other instance variables
C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started