Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a CPP for inventory item This programming project is due on Wednesday, November 15, 2023. Reminder: Do your own work on this project. Do

Write a CPP for inventory item image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
This programming project is due on Wednesday, November 15, 2023. Reminder: Do your own work on this project. Do not obtain any code from another student, or from the Intec net. Do not show your code to anyone except the instructor, or an official BHCC Tutor. Refer also to the last page of the course Syllabus, for details about the BHCC policy regarding academic dishonesty. Be sure that you read and understand this entire document before you begin writing your code. Pay close attention to the Project Deliverables and Grading Criteria sections of this document. If you have questions, ask the instructor during class or contact the instructor by BHCC e-mail: pmorgan/gbhociedu. Inventory Application Program This project involves designing and creating a CH+ program that will utilize the Inventoryltem class, which is deseribed in Section 13.10 (pages 803-807) and Section 13.12 (pages 809-812) of the Gaddis textbook. (The Inven tory I tem, h source code for this class is provided on Moodle.) Your program mus not modify the class specification for the Inveatoryliem class. The program must be organized as a "Command Loop" program. (Refer to the Ch06_sample_code_Commandloop... resource in the Sample Code section of Moodle.) The program must implement the following interactive commands: \begin{tabular}{|c|c|} \hline & \begin{tabular}{l} Add parts: increase the units value for an existing Inventeryliem object. \\ print Help text. \end{tabular} \\ \hline 1 & Input inventory data from a file. \\ \hline n & create a New inventory liem. \\ \hline 0 & Output inventory data to a file. \\ \hline & Priat inventory list on the screen. \\ \hline 9 & Quit (end the program). \\ \hline & Remove parts: reduce the units value for an existing Inventory Item objec \\ \hline \end{tabular} (Refer to the Requirements for Interactive Commands section of this document for more details.) The program must create an array of 100 Iaventoryltea objects (or a vector of Inventory Item objects). Data File Format The "input" / "output" commands read/ write data that is in a "pipe-delimited" text file. The format of each line of text, in the data file, is described below: When reading the data file, your program needs to read one line of text from the file at a time, break each line of text into separate fields (by calling the splitLineToArray function), and convert the text from each field to the correct data type. - Remember that the code to process the input file must ignore the first field of each line. There is no class variable in the InventoryItem class for imventory item number, and your program must not modify the InventoryItem class specification. - DO NOT create an inven toryItemNumber member variable in the Inventoryltem class. - Copy the splitLineToArray function that we discussed in class and is available on Moodle. The Sample Codesection of Moodle includes the Ch10_sample_code_SplitLineToArray_demo.... resource. The splitLine ToArray function is part of that sample program. (DO NOT blindly copy the entire program.) Important Design Requirements - When processing an input data file, be sure to remember that the first field of each line of data in the input file must be ignored. - The output file format must be the same as the input file format. That is, any file that your program creates with the " a " command must be readable by the " i " command of your program. - The units member variable of any Inventoryltem object must never be negative and also must never be greater than the value of 30 . Data File Format The "input" / "output" commands read/ write data that is in a "pipe-delimited" text file. The format of each line of text, in the data file, is described below: When reading the data file, your program needs to read one line of text from the file at a time, break each line of text into separate fields (by calling the splitLineToArray function), and convert the text from each field to the correct data type. - Remember that the code to process the input file must ignore the first field of each line. There is no class variable in the InventoryItem class for imventory item number, and your program must not modify the InventoryItem class specification. - DO NOT create an inven toryItemNumber member variable in the Inventoryltem class. - Copy the splitLineToArray function that we discussed in class and is available on Moodle. The Sample Codesection of Moodle includes the Ch10_sample_code_SplitLineToArray_demo.... resource. The splitLine ToArray function is part of that sample program. (DO NOT blindly copy the entire program.) Important Design Requirements - When processing an input data file, be sure to remember that the first field of each line of data in the input file must be ignored. - The output file format must be the same as the input file format. That is, any file that your program creates with the " a " command must be readable by the " i " command of your program. - The units member variable of any Inventoryltem object must never be negative and also must never be greater than the value of 30 . Sample Test Data Four sample input files are provided: electrical.txt, fasteners.txt, miscellaneous.txt and plumbing.txt. The data files that your program creates must obey the same file format as these sample files. The program must work correctly with these files, as well as general files of similar format. Project Deliverables: The project source file(s) must be submitted to Moodle, using the Moodle Activity: CSC237_Project2 Submit your . cpp file(s) and any . h file(s) that you create. I will need to compile your code on my home computer in order to grade it. If you are submitting more than one file (. cpp and/or . h), do not enclose the files in a ZIP file. Moodle will allow you to submit multiple source files. For example: Do not submit the entire Visual Srudio project. Do not include the project folders, or any binary files. Grading Criteria \begin{tabular}{|l|c|} \hline \multicolumn{1}{|c|}{ Feature } & Portion of grade \\ \hline \begin{tabular}{l} 5. The program is clearly organized and commented so that it is easy to read \\ and understand. At a minimum, there must be a comment at the beginning \\ of each function that explains what that function does. Use your judgement \\ regarding any dditional comments that may be needed to make the \\ program easy to understand, without over-commenting the program. (As \\ you get more experience, your judgement about this will improve.) \end{tabular} \\ \hline 6. Use good variable names and function names: \\ - A variable name or function name must indicate something about \\ what that variable or function does in the program. \\ Variable names and function names must be not too short and not \\ too long. & \\ \hline 7. Place a brief summary of the program in comments at the beginning of each \\ source file that you create. Also be sure these comments have your name \\ and the due-date for the project. & \\ \hline 8. Cleanup any unused portions of code, such as "failed attempts" that you \\ later replaced. & \\ \hline 9. Cleanup any irrelevant comments & \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions