Answered step by step
Verified Expert Solution
Link Copied!

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:
1. the Analysis of the Problem (using Word or a text editor)
2. and your program Source Code (.cpp file).
3. The warehouse inventory list, text file (.txt)
You must attach all 3 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, Pseudo-code, 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 (1-Yes, 0-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 2D 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 1.50401
milled soap 1.50101
coconut oil 3.2580
mint toothpaste 8.45251
You MUST create an unordered list of 10 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:
1D Array - itemNames 1D Array itemCost 2D Array -itemNoShip
[0] lavender soap [0]1.50[0]401
[1] milled soap [1]1.50[1]101
[2] coconut oil [2]3.25[2]80
[3] mint toothpaste [3]8.45[3]251
[0][1]
Your program must implement the following menu options (looping until user wishes to exit), implement input validation, and call the following functions:
Menu Options:
1. Read in Inventory
2. Display Inventory
3. Write to File
4. 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 readInventory(string itemNames[], double itemCost[], int itemNoShip[MAX][2]);
void displayInventory(string itemNames[], double itemCost[], int itemNoShip[MAX][2]);
void writeFile(string itemNames[], double itemCost[], int itemNoShip[MAX][2]);
void logo();
void menu();itemNames,
NOTE: MAX is a global constant; i.e. const int MAX =10;
Sampl outputInventory.txt file:
Lavendar soap 1.5401
Milled soap 1.5101
Coconut oil 3.2580
Mint Toothpaste 8.25251
PSEUDO-CODE main function (one of many ways you can do your program)
a) Declare variables and arrays
b) Start do/while loop
i) call logo function
ii) call menu function
iii) read in menu input
iv) switch/if on men input
(1) if menu input is 1
(a) call readInventory function and capture returned value
(b) if returned value (file was not read) output error message and exit program
(2) if menu input is 2
(a) call displayInventory function
(3) if menu input is 3
(a) call writeFile function
(4) if menu input is 4
(a) output message exiting program
(5) if menu input is not 1-4 output error message
c) End do/while loop
CONSTRAINTS:
NO GLOBAL VARIABLES ALLOWED. (Automatic -3)
- 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. (2 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. (1 pts)
Code organization and use of whitespace. (2 pts)

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

Step: 3

blur-text-image

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

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

What is the typical process of friendship development?

Answered: 1 week ago