Geek-aka HW2
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;
12 years ago
20
Purchase the answer to view it

- programupdated.cpp
Purchase the answer to view it

- invoice_answer.docx
- Product Assessment
- bus/fin
- NTC362 Week 2 Learning Team Assignment- Analog and Digital Comparison Paper
- ***SCI 241 Week 6 DQ 1*** ( SCI 241 Week 6 DQ 1 )
- PROJ430 - Week 2 - Continue to Define and Organize Your Project, and Start the Planning
- PR Communication COM530 The company with which (answer attached)
- x=4km/h×3hr
- Accounting class
- Bid
- Solve the inequality 8-2x>14 by first subtracting 8 from both sides