Question
This is a substantial project and could be a candidate for your e-portfolio. For week 4s assessment we will be creating a real-world solution that
This is a substantial project and could be a candidate for your e-portfolio. For week 4s assessment we will be creating a "real-world" solution that could be used by a company for inventory control.
There are 4 separate programs. Please keep them separate and submit 4 separate solutions. The requirements of this project are the development of a program that includes an inventory class with data members for stock number, quantity, price, also overloaded data entry and output operators. The data entry operator function should throw an error message if:
An error message, if the stock number is negative or higher than 999
An error message if the quantity is less than 0
An error message if the price is over $100.00
Your programs need to perform the following tasks:
1) Write a main() function that instantiates an array of five Inventory objects, and accepts data for each. Display an appropriate error message for each exception situation. When an exception is detected, replace all data fields with zeroes. At the end of the program, display data fields for all five objects. Save the file as Inventory1.cpp.
2) Write a main() function that instantiates an array of five Inventory objects and accepts data for each. If an exception is thrown because of an invalid stock number, force the user to reenter the stock number for the Inventory object. If the quantity is invalid, do nothing. If the price is in error, then set the price to 99.99. (Add a setPrice() function to the Inventory class to accomplish this.) At the end of the program, display data fields for all five objects. Save the file as Inventory2.cpp.
3) Write a main() function that instantiates an array of five Inventory objects and accepts data for each. If an exception is thrown because of an invalid stock number, force the stock number to 999; otherwise, do nothing. (Add any needed functions to the Inventory class.) At the end of the program, display data fields for all five objects. Save the file as Inventory3.cpp.
4) Write a main() function that instantiates an array of five Inventory objects and accepts data for each. If any exception is thrown, stop accepting data. Display as many objects as were entered correctly. Save the file as Inventory4.cpp.
Because this is a portfolio quality project, please fully comment all of your code, including a descriptive header for each code file, and provide design documentation in the form or a MS-Word document or a PowerPoint presentation. Compile this application using Visual Studio and run it to make sure it is error free.
This is for C++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started