Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M92029361

Have any Question?


Related Questions in Programming Language

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As