Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your final submission will result in three files: 1 . the Analysis of the Problem ( using Word or a text editor ) 2 .
Your final submission will result in three files:
the Analysis of the Problem using Word or a text editor
and your program Source Code cpp file
The warehouse inventory list, text file txt
You must attach all files in the Assignment Files section in Blackboard, do not submit separately or
you will not receive full credit for the assignment.
To begin, read through the following Problem Description and the associated Sample Output, Pseudocode, and Constraints. Then follow the proceeding instructions outlining the role of each group member.
PROBLEM DESCRIPTION: Warehouse Inventory List
Your company has grown and now stores all its inventory at an offsite warehouse. Each week the warehouse emails you an updated list of all the items in inventory in a text file in the following format:
Item Description Cost Per Item No of Items Shipping Yes, No
You will develop a program that will read in the inventory text file from the warehouse into three parallel arrays, an array of strings for the item description, an array of doubles for the Cost Per Items, and a D array of integers to store the fields No of Items and Shippable.
You may use the following to test.txt data to test your program and as an example to follow for your inputInventory.txt file. You may NOT use any of the items in this list for your inputInventory.txt file:
Test.txt
lavender soap
milled soap
coconut oil
mint toothpaste
You MUST create an unordered list of Items for your company that will be read into your program and then output to a text file named outputInventory.txt You will name the file inputInventory.txt You MUST use the format shown above with Item Description, Cost Per Item, No of Items and Shippable as your fields in the specified order.
The following is a visual example of the arrays you will create using the Test.txt shown above.
Sample of Parallel Arrays using Test.txt:
D Array itemNames D Array itemCost D Array itemNoShip
lavender soap
milled soap
coconut oil
mint toothpaste
Your program must implement the following menu options looping until user wishes to exit implement input validation, and call the following functions:
Menu Options:
Read in Inventory
Display Inventory
Write to File
Exit
Input Validation:
The program must check to see if the user enters a valid number for the menu option.
Do not call any other functions or allow the program to continue if the file was not read in
Functions the function prototypes:
bool readInventorystring itemNames double itemCost int itemNoShipMAX;
void displayInventorystring itemNames double itemCost int itemNoShipMAX;
void writeFilestring itemNames double itemCost int itemNoShipMAX;
void logo;
void menu;itemNames,
NOTE: MAX is a global constant; ie const int MAX ;
Sampl outputInventory.txt file:
Lavendar soap
Milled soap
Coconut oil
Mint Toothpaste
PSEUDOCODE main function one of many ways you can do your program
a Declare variables and arrays
b Start dowhile loop
i call logo function
ii call menu function
iii read in menu input
iv switchif on men input
if menu input is
a call readInventory function and capture returned value
b if returned value file was not read output error message and exit program
if menu input is
a call displayInventory function
if menu input is
a call writeFile function
if menu input is
a output message exiting program
if menu input is not output error message
c End dowhile loop
CONSTRAINTS:
NO GLOBAL VARIABLES ALLOWED. Automatic
Note: This means that all your arrays must be declared inside of main.
You must use: int main
The program must use local variables.
Program must loop until user wishes to exit.
All functions MUST be called by main.
Output must be formatted properly and correct. pts
Include a comment at the beginning of the program stating the purpose of the program, your group member names and roles, the date, and your class. pts
Code organization and use of whitespace. pts
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