Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Vectors Lab help: We had an activity today about vectors and I really don't know what to do, I would love some help! Please
C++ Vectors Lab help:
We had an activity today about vectors and I really don't know what to do, I would love some help! Please write the code in understandable basic vector code! Thank you!
Below are the question.(there are two images)
Please follow the instructions on the images. (function prototypes and the hints), Thank you very much!!!
The file looks something like this:
P-39457 A 16 102.14 P-11702 B 21 24.74 P-11754 B 27 15.23 P-12009 D 3 12.80
Purpose This experiment is designed to develop confidence with vectors. Readings: The experiment focuses upon the material on vectors covered in the text and in lecture. Instructions Write a program with a function to read in the file parts.txt into either parallel vectors or a vector of structs. The data file is on ANGEL in zipped format. The first few lines of the file look like: P-13725 A 23 61.46 P-13726 B 12 51.08 P-13754 D 27 4.56 P-13947 C 34 27 71 Representing part number, Class, On hand balance, cost. After the vector(s) has/have been filled, display a menu which allows the user to request the following reports 1. Total cost of inventory. 2. A count of parts of each class. 3. Cost of inventory for a class. 4. Part with the highest cost of inventory. 5. Part with lowest cost of inventory. 6. Exit. Each of these should be a function. I've posted a typical run on the next page. Hints: Use system ("cls") to clear the screen after the user makes a choice. There is a neat little trick you can use to count the classes based on the fact that the ascii value of 'A' is 65, 'B' is 66, etc. Not necessary but very efficient! Here is the struct and the prototypes of the functions I used: struct Parts string number; char cls int ohb; double cost; bool readFile (vectorStep 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