Inventory Accounting Program
Order instructions:Consider how you might modularize the code in your project. What kind of data will the functions take as arguments and what kind of data will the functions return?
Where will the functions be called? Modify your pseudocode and flowchart(s) from Module 04 by modularizing the program using functions as appropriate. You should
continue working on translating your project’s pseudocode into C++ code and testing it.Update attached files accordingly to this assignment
Inventory Accounting Program – Pseudocode and FlowchartPseudocode1. Start2. Declare totalInventoryItems as Whole Number3. Set totalInventoryItems to 504. Declare 1-Dimentional arrays ItemCodes, ItemNames, ItemDesc as Text with length of totalInventoryItems5. Declare 1-Dimentional arrays ItemQtyInStock, ItemQtySold as Whole Number of length of totalInventoryItems6. Declare 1-Dimentional arrays ItemWCost, ItemRCost as Fractional Numbers of length of totalInventoryItems7. Set ItemsListIndex = 0 8. Declare variable myOption as Whole Number9. Set myOption = 010. Display Menua. Display “1. Add Item to Inventory”b. Display “2. Remove Item from Inventory”c. Display “3. Edit Inventory Item”d. Display “4. Show Inventory Item Info”e. Display “5. Quit Program”11. Display “Enter your Choice”12. Read myOption13. While myOption is not equal to 5 A. If myOption is 1i. Display “Enter Item Info:”ii. Read Item Code into ItemCode at ItemsListIndexiii. Read Item Name into ItemName at ItemsListIndexiv. Read Item Description into ItemDesc at ItemsListIndexv. Read the Wholesale Cost into ItemWCost at ItemsListIndexvi. Read the Retail Cost into Item at ItemsListIndexvii. Read the Quantity in Stock into ItemQtyInStock at ItemsListIndexviii. Read the Quantity Sold into ItemQtySold at ItemsListIndexix. Set ItemsListIndex to ItemsListIndex + 1 at ItemsListIndexB. End IfC. Else If myOption is 2i. Get Index of Item to Remove (Search the ItemCodes array)a. Declare ItemIndex as Whole Numberb. Set ItemIndex to 0c. Declare inputCode as Textd. Display “Enter the Item Code”e. Read inputCodef. While ItemIndex is less than ItemsListIndexi. Traverse the ItemCodes array at ItemIndex positionii. If ItemCode = inputCode1. Exit from Loopiii. End Ifiv. Set ItemIndex to ItemIndex + 1g. End Whileii. If ItemIndex = ItemsListIndex1. Display “No Match found”iii. End Ifiv. Else1. Declare Text as Choice2. Declare Choice as Empty3. Display “Are you sure you want to delete? Y or N”4. Input Choice5. If Choice is Ya. Declare Temp Text arrays of length totalInventoryItems for ItemNames and ItemDescb. Declare Temp Fractional Number arrays of length totalInventoryItems for ItemWCost and ItemRCostc. Declare Temp Whole Number arrays of length totalInventoryItems for ItemQtyInStock and ItemQtySoldd. Copy ItemCodes from 0 to ItemIndex-1 into Temp arrayse. Copy ItemCodes from ItemIndex+1 to ItemsListIndex -1 into Temp arraysf. Copy Temp arrays to ItemCodes arrayg. Repeat Steps 4 to 6 for ItemNames, ItemDesc, ItemWCost, ItemRCost, ItemQtyInStock and ItemQtySold arraysh. Set ItemsListIndex to ItemsListIndex – 1i. Display “Item Deleted Successfully”6. End Ifv. End ElseD. End IfE. Else If myOption is 3i. Get Index of Item to Edit (See Step C-i.) ii. If ItemIndex = ItemsListIndex1. Display “No match found”iii. End Ifiv. Else 1. Display “Leave prompt empty if do not want to edit”2. Declare Value as Text3. Set Value to Empty4. Declare Text name, desc, 5. Declare Fractional Numbers wcost, rcost6. Declare Whole Numbers qtyInStock, qtySold7. Set name to ItemName at EditItemIndex8. Set desc to ItemDesc at EditItemIndex9. Set wcost to ItemWCost at EditItemIndex10. Set rcost to ItemRCost at EditItemIndex11. Set qtyInStock to ItemQtyInStock at EditItemIndex12. Set qtySold to ItemQtySold at EditItemIndex13. Display “Item Name” and name14. Read Value15. If Value is not Emptya. Replace name with value16. End If17. Repeat Step 11 to 14 for desc, Wcost, rcost, qtyInStock,QtySold18. Store variables from Step 4 to their respective arrays at ItemIndexv. End ElseF. End IfG. If myOption is 4i. Get Item Index to Show (Call Step C-i)ii. If ItemIndex = ItemsListIndex1. Display “No match found”iii. End Ifiv. Else 1. Display “Requested Item Information”2. Display Item Code3. Display Item Name4. Display Item Description5. Display Item Quantity6. Display Wholesale Cost7. Display Retail Cost8. Display Quantity in Stock9. Display Quantity Soldv. End ElseH. End IfI. Elsea. Display “Invalid Option”J. End ElseK. Display Menu from Step 10L. Display “Enter your Choice”M. Read myOption14. End While15. Display “Program Ended”16. StopFlowchart
