Implement a menu-driven program for a hardware store

Assignment Help Programming Languages
Reference no: EM131274639

SPECIFICATION

Objective:

In this assignment, you will learn to write a program using linked list and tree data structure.

Remember that:

1. All programs should be able to run on the lab's computers.

2. You must put the following information on the header of each text and source file you will be submitting in this assignment:

Student's full name: Student's ID:

Modification Date:

Purpose of this file (or program):

3. Assignments that are not able to be compiled will result in zero mark given to the assignment.

4. You must only use the C++ features that have already been covered in the lectures

TASKS:

Implement a menu-driven program for a hardware store that keeps the inventory records and also the sale transaction records for all its hardware items. Each hardware item is known with its barcode, description, price per unit, and quantity in hand. Use a suitable struct declaration to represent each item's record. All the hardware items' information is stored in a binary search tree to allow fast retrieval of a particular record. Each transaction record, which consists of invoice number, hardware item's barcode, quantity purchased, and the total price, is stored in a linked list data structure.

The program starts by reading a filename containing a list of hardware items information. Construct a binary search tree to store all the hardware items read from this file with the barcode as the key. A menu should be displayed to allow a user to perform the following operations:

- Update a hardware item's quantity in hand or price per unit

- Add a new hardware item

- Display either all items or one item's record by reading the barcode

- Perform a sales transaction - allow several hardware items to be purchased

- Remove a sales transaction based on invoice number

- Edit a sales transaction by changing the hardware item's barcode and/or quantity purchased

- Display all sales transaction done together with a grand total sales amount

For each transaction performed, the program should prompt the user for a barcode and traverse the binary search tree to identify if the barcode exists. If it exists, prompt for the quantity and check it against the record stored in the binary search tree. No transaction should be done if the quantity in hand is not sufficient for the transaction.

If the record doesn't exists, request if the user would like to add a new record and continue with the transaction, otherwise go back to main menu. If a transaction is done, add a new node containing the transaction details to the end of the linked list. The program should start with an empty linked list. A node should contain only one hardware item's information. If the transaction involved more than one hardware item, then more than one node should be created and added to the linked list.

Before the program terminates, update the file containing the hardware items' information and add to a transaction file all the transaction records in the list. Use functions to implement each option. Each data structure (linked list and binary search tree) must be implemented as a class and store each classes in separate .cpp files with appropriate headers. Your driver program should be saved in a file named main.cpp.

Reference no: EM131274639

Questions Cloud

Create an arraylist of type string and prompt : a) Create an Arraylist of type String and prompt the user for three names and add these names to your ArrayList. b) Print a message with the number of elements in the ArrayList for the user using the size() method (to find the number to print.)
What approach did each of the countries take : What approach did each of these countries take, and what was the change in GDP for each one of these economies from 2008 until present? Which tools do you feel were successful and why?
Design a material and its processing for the rungs : You wish to design the rung on a ladder. The ladder should be light in weight so that it can be easily transported and used. The rungs on the ladder should be 0.25 in. x 1 in. and are 12-in. long. Design a material and its processing for the rungs..
What long-term steps can be taken by countries : What alternative selection procedures discussed in this chapter could an employer use to screen potential "bad actors" that would not involve outsourced background checks?
Implement a menu-driven program for a hardware store : Perform a sales transaction - allow several hardware items to be purchased Remove a sales transaction based on invoice number and Edit a sales transaction by changing the hardware item's barcode and/or quantity purchased
Write a program that calculates average of n integers : Write a program that calculates the average of N integers. The program should prompt the user to enter the value for N and then afterward must enter all N numbers. Use an array to save the N integers.
Distinction between a void and a voidable contract : Explain the distinction between a void and a voidable contract; between an executed and an executory contract; between a unilateral and a bilateral contract.
Explain your experiences using resources : Describe your experiences using resources, including concerns encountered when conducting academic research through the Ashford University Library.
Difference between liquidated and unliquidated debts : Describe the three requirements for a valid offer.-  Explain how an offer can be terminated. -  Explain the difference between liquidated and unliquidated debts.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd