Question
C++// Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice
C++// Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four data members: a part number (string), a part description (string), a quantity of the item being purchased (int), and a price per item (double). Each invoice object represents the purchase of one item.
Your class should have one constructor that accepts four values and initializes the four data members with these values. Provide a set and get function for each data member. In addition, provide a member function called getInvoiceAmount that calculates the invoice amount (quantity * price) and returns this amount. If the quantity is not positive, set it to zero. If the price is not positive set it to zero. Write a main program to test your class.
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