productType.h Code file given #include   using namespace std; class productType                                {                                                public:                                              productType();                                   productType(int, double, double);                productType(string, int, double, double);        productType(string, string, string,                  int, double, double);                void set(string, string, string, int,               double, double);                       void print() const;                              void setQuantitiesInStock(int x);                void updateQuantitiesInStock(int x);            int getQuantitiesInStock() const;                void setPrice(double x);                         double getPrice() const;                         void setDiscount(double d);                      double getDiscount() const;                        private:                                             string productName;                              string id;                                       string manufacturer;                             int quantitiesInStock;                           double price;                                    double discount;                             };

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
icon
Related questions
Question

Programming Exercise 10-2

productType.h Code file given

#include <string> 

using namespace std;

class productType                               
{                                               
public:                                         
    productType();                              
    productType(int, double, double);           
    productType(string, int, double, double);   
    productType(string, string, string, 
                int, double, double);           

    void set(string, string, string, int, 
             double, double);                  
    void print() const;                         

    void setQuantitiesInStock(int x);           
    void updateQuantitiesInStock(int x);       
    int getQuantitiesInStock() const;           

    void setPrice(double x);                    
    double getPrice() const;                    
    void setDiscount(double d);                 
    double getDiscount() const;                 
     
private:                                        
    string productName;                         
    string id;                                  
    string manufacturer;                        
    int quantitiesInStock;                      
    double price;                               
    double discount;                            
};                                              
Tasks
The program can initialize objects of type
product Type without error.
product Type 's getter and setter for
price work as expected.
product Type 's getter and setter for
discount work as expected.
product Type 's getter, setter, and
updater for quantities InStock work as
expected.
>
>
Transcribed Image Text:Tasks The program can initialize objects of type product Type without error. product Type 's getter and setter for price work as expected. product Type 's getter and setter for discount work as expected. product Type 's getter, setter, and updater for quantities InStock work as expected. > >
Instructions
Instructions
Complete the implementation of the
product Type class defined in Exercises 8 and 10
of this chapter. The header file has been provided
for you.
Write a program to test your implementation file.
Transcribed Image Text:Instructions Instructions Complete the implementation of the product Type class defined in Exercises 8 and 10 of this chapter. The header file has been provided for you. Write a program to test your implementation file.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,