Simulate operation of a grocery store checkout system

Assignment Help Data Structure & Algorithms
Reference no: EM133641585

Grocery Store Checkout

You MUST submit your work to Canvas by the due date. Late assignments are NOT accepted after the due date. You may turn in your assignment as early as you would like.

Write, run, and test a C++ program to simulate the operation of a grocery store checkout system. Your program should first build a data structure to contain information on all the products available in the store. Then the program should print the cash register receipt for each customer. You need to use the books code for any data structures that you will use. In this assignment you must use the books code for an unsorted list.

Input
The input for this program has two sources: the inventory information is input from a text file, and the customer transactions are input from the keyboard.

The information about each product carried by the store is listed on a single line in the inventory file "Invent.dat", in the following format:
<product number> <description> <price> <tax> where <product number> is a five-digit positive (nonzero) integer,
<description> is a string of at most 12 characters with no embedded blanks, <price> is a real number, and <tax> is a character ('T' if the product is taxable; 'N' if it is not taxable). The data in the inventory file is ordered from smallest to largest product number.
The customer transactions are input from the keyboard, in the following format:
<product number> <times>

where <product number> is as described above, and <times> is an integer in the range 1 to 100, indicating the quantity of this product desired. A zero input for <product number> indicates the end of the customer's order. (The store will soon be using a scanner to input the product number, but for now it is typed in by the cashier.)

Output
The program outputs should be written to a text file called "Receipts.out".

The inventory information is echo printed to the output file. (Echo means that the same output is printed on the console and printed to the output file)

The cash register receipt for each customer is written to the output file. The receipts should be nicely formatted, with the product description (not the product number), number of items, item price, and total price for each product printed on a single line. At the end of each customer's order, the subtotal for all items, amount of tax on taxable items, and total bill should be printed, clearly labeled. (The tax rate is 7.5% for taxable items.)

Processing
The program first reads in all of the inventory information from file "Invent.in", echo printing the information to the output file. The program then prompts the cashier to begin inputting the order for the first customer. This customer's order is processed, and the receipt is printed to the output file.

After each customer's order is processed, the program should ask the cashier if another customer is to be processed. If the answer is 'Y', the program sets up to process the next customer; if the answer is 'N', the program terminates with a friendly message.

Error Checking
The following input errors are possible and should be handled by an exception class:
Duplicate <product number> in inventory file. Write an error message to the output file and skip the second entry.

<Product number> not in inventory file. Write an error message on the receipt, ignore that product number, and continue with the next item.
<Times> not in the specified range. Write an error message to the output file, ignore that line, and continue with the next item.

Data Structures

The inventory information can be stored in an array or linked list of product records. Assume that the maximum number of distinct products is 50, for purposes of writing this program. You should specify this data structure as an ADT, as described in the book; define and implement a set of operations to encapsulate it. The ADT should be tested using a test driver.

Do not use anything that would require you to include the libraries algorithm.h or vector.h or similar. If you have any questions about this, let me know before submitting the assignment.

Remember that your code must be appropriately commented. You must use inline comments and block comments. (Your class member function comment blocks should be above your function declarations in your header file.)

Attachment:- Grocery Store Checkout.rar

 

Reference no: EM133641585

Questions Cloud

Explain how an auction to sell wells fargo consumer-facing : Explain how an auction to sell the Wells Fargo consumer-facing banking division might be used to determine the value of the division.
What is a tool used in collecting statistical data : What is a tool used in collecting statistical data on crime reporting? What are its strengths and weaknesses for reporting on victims
Identify at least one other possible market failure : Identify at least one other possible market failure that may be present in the cryptocurrency market. Is the failure due to moral hazard or adverse selection?
Simulate the operation of a grocery store checkout : Write, run, and test a C++ program to simulate the operation of a grocery store checkout system. Your program should first build a data structure
Simulate operation of a grocery store checkout system : CIS-65 Prgrming Cncpts/Method - C++, Shasta College - Simulate the operation of a grocery store checkout system and build a data structure
Calculate the expected gain or loss for a corporation : If yearly price of purchasing a network interruption insurance is $100,000, calculate the expected gain or loss for a corporation that purchase this insurance.
Discuss key insights about application of leadership theory : First, share and briefly discuss the two key insights about application of leadership theory that represent new learning as result of completing the project.
Discuss the ways you are going to seek to gain commitment : You are trying to get a friend or family member to purchase. What is role of timing in this approach? Discuss ways you are going to seek to gain commitment.
Explain how these actions can contribute : Elaborate on at least two forms of participation in which you would like to personally get involved, and explain how these actions can contribute to the health

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  What is the best order for sending people

More precisely give an efficient algorithm that produces a schedule whose completion time is as small as possible.

  Creating an object oriented data model

Create an object oriented data model, including all appropriate notations, to represent the given situation. In a particular region there are a number of gardens.

  A program that performs depth first search in a graph

a program that performs Depth First Search in a graph

  Create an application to implement apriori algorithm

Create an application to implement Apriori Algorithm and demonstrate the two main phases in it, which are i) Generation of frequent itemsets; ii) Generation of association rules.

  Describe a simple greedy algorithm

Describe a simple greedy algorithm that computes a 2-approximation of the optimal schedule. In other words, if T* is the smallest possible makespan achievable for the given set of jobs using k processors, then the schedule produced by your algorit..

  Create a solution algorithm using pseudocode

Algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient.

  Example of experiment that has a qualitative variable

Give an example of an experiment that has a qualitative (nominal) independent variable and a quantitative (ordinal, interval, or ratio) dependent variable

  Symmetric difference for corresponding set operations

Union With computes the union of two sets using |, the word-parallel bitwise OR operator. Implement methods for Intersect With, Difference With, and Symmetric Difference for the corresponding set operations. (The symmetric difference of two sets ..

  F28DA Data Structures and Algorithms- Assignment Problem

F28DA: Data Structures and Algorithms Assignment Help and Solutions, Heriot-Watt University, UK, Your task is implement a Flying Planner which uses a graph.

  Identify the critical path for the given activity

Consider Problem. Suppose that the normal and the expedited costs and times are as given in the following table.

  Explain feasibility analysis for jobs of lrt algorithm

Study feasibility analysis for jobs of LRT algorithm when preemption is allowed. Which scheduling algorithm is best suited for high speed networks and why? Distinguish between static and dynamic systems.

  Write a program that will perform the same operations twice

Write a program that will perform the same operations twice, once using an array of structs, and once using a pair of parallel arrays. The data will represent people's names and ages, so the first data structure will be an array of structs.

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