Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ please use C++ to code Write a program with a function to read in the file parts.txt into either parallel vectors or a vector

C++ please use C++ to code image text in transcribed
image text in transcribed
image text in transcribed
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 ? 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 . 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 s. 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 choice. Use system ("cls") to clear the screen after the user makes a 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 (vector &pVector) int displayMenu ); double totalCost (const vector &pVector) void countByClass (const vector & pVector

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago

Question

8. Design office space to facilitate interaction between employees.

Answered: 1 week ago