Question: Problem 1 is from the textbook exercise 3 . 1 0 . 3 . 1 0 ( Invoice Class ) Create a class called Invoice

Problem 1 is from the textbook exercise 3.10.3.10(Invoice Class) Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the stoe. An Invoice should include four data members-a part number (type string), a part description (type string), a quantity of the item being purchased (type int) and a price per item (type int). Your class should have a constructor that initializes the four data members. Provide a set and a get function for each data member. In addition, provide a member function named getInvoiceAmount that calculates the invoice amount i.e., multiplies the quantity by the price per item), then returns the amount as an int value. If the quantity is not positive, it should be set to o. If the price per item is not positive, it should be set to 0.Write a test program that demonstrates class Invoice's capabilities.Task 1.1 address the requirements in above problem statement. The test program should follow the unit testing structure introduced at the lecture demos. (A reference example is on the "Summary and reference" web page on Moodle.)(20 points)Incrementally, we develop the Invoice class with the following extra specification.Task 1.2 add the copy constructor of class Invoice. (5 points)Task 1.3 add the destructor of class Invoice.(5 points)Task 1.4 define a public member function called clone) that returns an Invoice object with the identical values of the current Invoice object. (5 points)Task 1.5 define a public member function with overloaded form of clone (const Invoice & that returns an Invoice object with the identical values of the pass-by-referenceInvoice object. (5 points)Task 1.6 write a test program to demonstrates class Invoice's capabilities defined in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!