Item myNotebook(3.00,"notebook");
Item *myNotebook = new Item(3.00,"notebook");
Make the instance variables private and provide access methods getPrice and getKind to allow the rest of the world to see (but not change) them.
Also write a method to print out all the information about an Item in an easily-readable format. You may do this either as a "toString" method that returns a string, or by overloading the "<<" operator. This will be very helpful to you in testing and debugging your program.
You should design, write, test, and debug this class completely before going on to the Inventory class. To help with testing, I recommend that you write a testItems function that creates a variety of items (notebooks, textbooks, sweatshirts etc.), then prints out their prices, kinds, and sales taxes (using the aforementioned methods), along with what the answers should be.
For now, the Inventory class constructor will set the array to contain (pointers to) five items: let's say a $45 textbook, a $70 textbook, a $3.00 notebook, a $7.50 appointment calendar, and a $20.00 sweatshirt. This may change on the day the assignment is due, and it will definitely change in the next assignment, so write your program in such a way that you can modify this easily.
The Inventory class should have a method named totalPrice which computes and returns the total price of all the items in the array. Obviously, the right answer for now should be $145.50, but your method must actually compute this from the contents of the array, so that when the size and contents of the array change, this method will still work.
The Inventory class should also have a method named averagePrice which computes and returns the average price of all the items in the array.
Also write a method to print out all the information about an Item in an easily-readable format. You may do this either as a "toString" method that returns a string, or by overloading the "<<" operator. This will be very helpful to you in testing and debugging your program.
To help with testing, I recommend that you write a testInventories function that creates an Inventory, then calls the aforementioned methods and prints out the results, along with what they should be.