ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 08 May 2017 My Price 11.00

Using C++ to track the inventory of various "items

I am sorry but does it works for you if i change the deadline. Thank you !

Using C++ to track the inventory of various "items", read and process a transaction file (partially displayed below).  The transaction file contains 5 types of transactions. Store a count of the items in a sorted linked list. 

Details 

  • . The transaction file contains slightly over 100 random transaction entries.  The five transaction type entries are:
  1. - add <item number> - add the item to the inventory, or increase the count for that item 
  2. - subtract <item number> - subtract the item from the inventory, or decrease the count for that item
  3. - print inventory - print the contents of the linked list (in sorted order) as shown below
  4. - misspelled transactions (add, subtract, or print may be misspelled) - print an error message, including the line number in the file
  5. - blank lines - skip over these (but count the lines)
  • . There are only 10 unique item numbers.

Program Requirements

Create  your own linked list and may not use any STL containers.

The linked list must be maintained in sorted order by the item number.

  1. The linked list node must contain the item number and a count of the number of that item that are added to the inventory.
  2. If the item is not in the inventory, then that node must be removed.
  3. Must print out the contents of the linked list when a "print inventory" transaction record appears.  See sample output below.
  4. Must write at least 2 classes, a "node" class and a "linked list" class.  Both classes must contain constructors and the "linked list" class must have a destructor.
  5. Must include at least two overloaded operators as member functions.
  6. The print function of the "linked list" class must be implemented as an overloaded insertion operator function.
  7. Input File

This is the first 32 records of the input file.

add 9171

add 6503

add 0042

 

add 0042

add 4467

 

add 6965

ad 8469

add 8469

 

subtract 4467

subttact 9171

add 6335

add 6503

add 8469

subtract 6503

add 4467

subtract 0042

subtract 8469

add 6335

subtract 6503

add 1480

subtract 8469

add 1480

 

add 9171

add 1480

subtract 6335

print inventory

subtract 9171

subtract 6335

...

Program Output

Here is some partial output from the program.  

Output

Bad transaction: ad in line #9

Bad transaction: subttact in line #13

 

Item  Quantity

0042       1

1480       3

4467       1

6335       1

6965       1

9171       2

 

Bad transaction: prlnt in line #51

 

Item  Quantity

0042       1

1480       4

4467       2

5726       1

...


This output shows the contents of the linked list after the first print inventory transaction (plus a few more lines). 

 

add 9171add 6503add 0042add 0042add 4467add 6965ad 8469add 8469subtract 4467subttact 9171add 6335add 6503add 8469subtract 6503add 4467subtract 0042subtract 8469add 6335subtract 6503add 1480subtract 8469add 1480add 9171add 1480subtract 6335print inventorysubtract 9171subtract 6335add 9361add 8469add 4467add 9171add 6965add 0042add 9171add 9171add 1480add 9171add 9171subtract 0042add 4467add 9361add 5726add 0042subtract 0042prlnt inventorysubtract 4467add 9171print inventoryadd 6965add 5726add 5726add 9171add 1480aad 9361add 0042add 9171add 6335subtract 6335

Attachments:

Answers

(11)
Status NEW Posted 08 May 2017 01:05 AM My Price 11.00

-----------

Not Rated(0)