Create a class called invoice


Create a class called Invoice that a hardware store may use to represent an invoice for an item sold at the store. The class should have four (4) instance variables:

part number : string
part description : string (what is the item)
quantity being purchased : int
price per item : double
Create a constructor that initializes the four data members. Also use default parameters with your constructor.

Create an accessor and mutator for each data member as well.

Create a member function named getInvoiceAmount that calculates the invoice amount. If the quantity is less than 0, it should be set to 0. If the price per item is also negative, that should be set to 0 as well.

You may create a function that dsplays the receipt.

For extra credit, write a method to overload the ostream and istream operators so any object of the class can be displayed in a cout statement and the object values can be inputted using cin. E.g.
Invoice i;

cin >> i;

cout << i;

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Create a class called invoice
Reference No:- TGS0535126

Expected delivery within 24 Hours