logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

This project involves designing and creating a C++ program which will utilize the InventoryItem class

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Inventory Application Program

This project involves designing and creating a C++ program which will utilize the InventoryItem class, which is described in Section 13.10 (pages 771-775) and Section 13.12 (pages 777-780) of the Gaddis textbook. (The InventoryItem.h source code for this class is provided on Moodle.)

The program should create an array of 100 InventoryItem objects and support the following interactive commands:

  • a Add parts: increase the units value for an existing inventory

  • h print Help

  • i Input inventory data from a

  • p Print inventory list.

  • n create a New inventory

  • o Output inventory data to a

  • q quit (end the program).

  • r Remove parts: reduce the units value for an existing inventory

 

Data File Format

The “input” / “output” commands read / write data which is in a “pipe-delimited” text file. The format of each line of text, in the data file, is described below:

File Format

inventory item number | description | cost | units

 

 

Explanation of Data Fields

Field name

Explanation

inventory item number

For the output file, this number can be the same as the array index.

For the input file, the contents of this field will be ignored, because the input data will be appended to the end of the “populated” portion of the InventoryItem array.

description

Description of the inventory item

cost

Cost per unit for the inventory item

units

Number of units present for the inventory item (must be greater than or equal to zero and less than or equal to 30).

 

Sample Test Data

Four sample input files are provided: electrical.txt, fasteners.txt, miscellaneous.txt and plumbing.txt. The data files which your program creates must obey the same file format as these sample files.The program should work correctly with these files, as well as general files of similar format.

 

 

 

electrical.txt

0|Cable|5.00|18

1|Extension Cord (14/3, 25 ft)|27.95|6 2|Light switch (15 amp)|2.79|10 3|Ceiling Fan (52 inch)|79.95|3

4|Vinyl Electrical Tape (20 ft roll)|0.79|30

5|GFI Tester|9.35|5

 

fasteners.txt

0|Turnbuckle|3.80|25

1|Siding nails (box of 100)|4.00|20 2|Flat washer (box of 100)|2.80|30 3|Machine screw (box of 100)|3.20|10 4|Hex bolt (box of 100)|6.50|23 5|Hex nut (box of 100)|3.80|15

6|Sheet Metal Screw (qty 100)|1.50|28

 

miscellaneous.txt

0|Door Hinges (3-pack)|6.30|10 1|Rubber work boots (1 pair)|28.00|5 2|Leather Work Gloves (1 pair)|12.00|8

3|Long Handle Grass Shear|30.00|5

 

plumbing.txt

0|Pump|39.00|20 1|Gasket|1.50|29

2|Water Level Guage|12.99|30 3|Faucet Repair Kit|4.89|8

4|Teflon Thread Seal Tape (50 ft roll)|3.30|12

5|shutoff valve|6.50|10

 

Sample Interactive Session

In the sample data on the next several pages, what the user types is shown in bold. In actuality, what the user types would appear as the same text format as the rest of the output.

Sample Interactive Session

Command: h

Supported commands:

a                Add parts.

h                          print Help text.

i                          Input inventory data from a file.

p                Print inventory list.

n                New inventory Item.

o                Output inventory data to a file.

q                          quit (end the program).

r                          Remove parts.

 

Command: i

Enter name of input file: plumbing.txt

6 records loaded to array. Command: p

Item Num     Description                                       Cost    Quantity 0         Pump                                             39.00           20

1         Gasket                                            1.50           29

2              Water Level Guage                                12.99           30

3              Faucet Repair Kit                                 4.89            8

4              Teflon Thread Seal Tape (50 ft roll)               3.30           12

5              shutoff valve                                     6.50           10

6  records.

Command: i

Enter name of input file: electrical.txt

6 records loaded to array. Command: p

Item Num     Description                                       Cost    Quantity 0         Pump                                             39.00           20

1         Gasket                                            1.50           29

2              Water Level Guage                                12.99           30

3              Faucet Repair Kit                                 4.89            8

4              Teflon Thread Seal Tape (50 ft roll)               3.30           12

5              shutoff valve                                     6.50           10

6         Cable                                             5.00           18

7         Extension Cord (14/3, 25 ft)                      27.95            6

8              Light switch (15 amp)                              2.79           10

9              Ceiling Fan (52 inch)                             79.95            3

10            Vinyl Electrical Tape (20 ft roll)                 0.79           30

11            GFI Tester                                        9.35            5

12  records.

 

Sample Interactive Session

Command: a

Choose a Item Number: 7 How many parts to add? 5 Command: p

Item Num     Description                                       Cost    Quantity 0         Pump                                             39.00          20

1         Gasket                                            1.50           29

2              Water Level Guage                                12.99           30

3              Faucet Repair Kit                                 4.89            8

4              Teflon Thread Seal Tape (50 ft roll)               3.30           12

5              shutoff valve                                     6.50           10

6         Cable                                             5.00           18

7         Extension Cord (14/3, 25 ft)                      27.95           11

8              Light switch (15 amp)                              2.79           10

9              Ceiling Fan (52 inch)                             79.95            3

10            Vinyl Electrical Tape (20 ft roll)                 0.79           30

11            GFI Tester                                        9.35            5

12  records.

Command: r

Choose a Item Number: 9

How many parts to remove? 5

Error:  You are attempting to remove more parts than the Item currently holds. Command: r

Choose a Item Number: 9 How many parts to remove? 3 Command: p

Item Num     Description                                       Cost    Quantity 0         Pump                                             39.00           20

1         Gasket                                            1.50           29

2              Water Level Guage                                12.99           30

3              Faucet Repair Kit                                 4.89            8

4              Teflon Thread Seal Tape (50 ft roll)               3.30           12

5              shutoff valve                                     6.50           10

6         Cable                                             5.00           18

7         Extension Cord (14/3, 25 ft)                      27.95           11

8              Light switch (15 amp)                              2.79           10

9              Ceiling Fan (52 inch)                             79.95            0

10            Vinyl Electrical Tape (20 ft roll)                 0.79           30

11            GFI Tester                                        9.35            5

12  records.

Command: o

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

903 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

528 Answers

Hire Me
expert
Husnain SaeedComputer science

887 Answers

Hire Me
expert
Atharva PatilComputer science

551 Answers

Hire Me
June
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30