Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in c++ that will keep track of the car inventory at some regional auto stores. Your program should begin by reading the

Write a program in c++ that will keep track of the car inventory at some regional auto stores.

Your program should begin by reading the inventory from a data file named "inventory.txt". The first line of the file will contain the number of stores. You may assume that there will not be more than 100 stores. The remaining lines will have the number of cars at store #1, store #2, etc. A data file might look something like this:

5

22

33

14

9

47

After reading the file, your program should provide a menu-based system in which the user will have 4 options:

1 Display the inventory of all stores

2 Add some cars to a store

3 Remove some cars from a store

4 Quit the program

If the user chooses something besides 1 through 4, an "Invalid choice" message should be displayed.

When the user chooses options #2 or #3, the program should first ask for the store number (with data validation) and then ask for the quantity. The removal of cars should validate data.

If you run your program, the sample interaction might look something like that shown below (continuing on to the reverse side of this sheet). Feel free to modify the look and feel, as well as the wording, to make your program user-friendly.

image text in transcribedimage text in transcribed

Car inventory program 1. Display Inventory 2. Add some cars 3. Remove some cars 4. Quit the program Choice: 1 Store Count 1 2 14 47 Car inventory program 1. Display Inventory 2. Add some cars 3. Remove some cars 4. Quit the program Car inventory program 1. Display Inventory 2. Add some cars 3. Remove some cars 4. Quit the program Choice: 1 Store Count 1 2 14 47 Car inventory program 1. Display Inventory 2. Add some cars 3. Remove some cars 4. Quit the program

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

Data Analysis Using SQL And Excel

Authors: Gordon S Linoff

2nd Edition

111902143X, 9781119021438

More Books

Students also viewed these Databases questions