Question: Assignment /OOP 1. (Invoice Class) Create a class called Invoice that is used to represent an Invoice for an item sold at the store. An

Assignment /OOP 1. (Invoice Class) Create a class called Invoice that is used to represent an Invoice for an item sold at the store. An Invoice should include four pieces of information as private data members: A part number (type string), A part description (type string), A quantity of the item being purchased (type int) A price per item (type double). Your class should have a constructor that initializes the four data members. Provide a member function named getInvoiceAmount that calculates the invoice amount (l.e., multiplies the quantity by the price per item), then returns the amount as a double value. If the quantity is not positive, it should be set to 0. If the price per item is not positive, it should be set to 0. Write a test program that demonstrates class Invoice's capabilities. 2. (Employee Class) Create a class called Employee that includes three pieces of information as private data members A first name (type string). A last name (type string). A monthly salary (type double). Your class should have a constructor that initializes the three data members. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee's capabilities. Create two Employee objects and display each object's yearly salary. Then give each Employee a 10 percent raise and display each Employee's yearly salary again. 3. (Date Class) Create a class called Date that includes three pieces of information as data members: A month (type int). A day (type int) A year (type int). Your class should have a constructor with three parameters that uses the parameters to initialize the three data members. Provide a member function displayDate that displays the month, day and year separated by forward slashes (/). Write a test program that demonstrates class Date's capabilities
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
