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 the program which approximates pi using series

Your problem is to write the program which approximates pi using above series. Allow the user to specify the number, n, of terms to be used.

  Modeling a game using turing machine

Modeling a Game Using Turing Machine, Select a game that can be modeled by a simple Turing machine. It should take a series of inputs (such as a set of moves by a player) and use the tape and table to compute the outcome of whether the player won o..

  Writing code in client program to enter score

Write down code in a client program to perform the following: prompt user to enter score and set score data member for player1.

  Define a class named document that contains an variable

Define a class named Document that contains an instance variable of type String named text that stores any textual content for the document. Create a method named toString that returns the text field and also include a method to set this value.

  Business rules form the basis of the database design.

A member receives many invitations, and each invitation is sent to many members.

  Translate the given code into mips64 assembly language

you can use the instructions 'blt' (branch on less than), 'ble' (branch on less or equal), 'bgt' (branch on greater than) and 'bge' (branch on greater or equal) - Translate the given code into MIPS64 assembly language.

  Which two are valid constructors for thread

Which two are valid constructors for Thread?1) Thread(Runnable r, String name)2) Thread()

  Program to prompt teacher to input assignment number

The program must prompt teacher to input the assignment number. Score for student for that assignment will be displayed.

  Write a program to generate a patient bill

Write programs in Visual Basic while being guided by the six steps of the program development cycle: analyze the problem, design a solution, choose the interface, write code, test and debug your solution, and document code.

  Write a marie program using a loop

Write a MARIE program using a loop that multiplies two non-negative numbers by using repeated addition. For example, to multiply 3 x 6, the program would add 3 six times (e.g. 3 + 3 + 3 + 3 + 3 + 3) or add 6 three times (e.g. 6+6+6). You should wr..

  Features of object oriented programming

Write a 200- to 300-word short-answer response to the following: Describe the main features of Object Oriented Programming - Encapsulation, Inheritance and Polymorphism

  Write a code to swap the letter passed through an array

Write a code to swap the letter passed through an array called letters. With int number of letters. Use must use pointers and pointer arithmetic.

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