Question: Problem 1 is from the textbook exercise 3 . 1 0 . 3 . 1 0 ( Invoice Class ) Create a class called Invoice
Problem is from the textbook exercise 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 membersa 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 ie 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 Write a test program that demonstrates class Invoice's capabilities.Task 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. pointsIncrementally we develop the Invoice class with the following extra specification.Task add the copy constructor of class Invoice. pointsTask add the destructor of class Invoice. pointsTask define a public member function called clone that returns an Invoice object with the identical values of the current Invoice object. pointsTask define a public member function with overloaded form of clone const Invoice & that returns an Invoice object with the identical values of the passbyreferenceInvoice object. pointsTask 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
