Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Do not use arrays or tables, functions are not required. Please show comments in code. Use a file called Stock.txt (I'll write the actual

C++

Do not use arrays or tables, functions are not required. Please show comments in code.

Use a file called Stock.txt (I'll write the actual file down below) that contains information regarding the 9 different stock items carried by GROCERY INC. The file is a repeating sequence of three records such that

the first record represents an item code number,

the second record represents the description of each item

and the third record contains the current selling price.

Then the sequence repeats. Your program is to simulate the checkout register allowing the check out clerk to input item codes to obtain the current selling prices and descriptions. If an incorrect code is entered, the clerk should be notified by an appropriate message on the screen. If the item is found, the clerk will enter the number of items with that description and price and continue to the next item. When all items have been entered the clerk terminates the transaction by entering an item code of 0 (zero).

The program will build a sales slip called Sales.txt (output file) enumerating the item code, description, unit price, quantity purchased, and total extended price. The bill will be subtotaled and an 8% sales tax added for a final total. Amount tendered by the customer and change given will be finally added to the invoice. This invoice should be written out to an output file called Sales.txt. The final total and change should appear on the screen as well.

Your output file should line up all columns and output formatted for dollars and cents on money amounts, using setprecision, showpoint, and fixed. Make sure you format your output to the screen as well. Do not use arrays or tables.

stock.txt (input file):

1234 Stockings 12.39 2865 Pajamas 17.99 4020 Dress 23.00 3640 Sweater 20.50 5109 Shorts 56.99 4930 TV 88.20 6600 ToothBrush 94.55 5020 AluminumPan 16.79 2336 Pencils 4.55

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

The models used to analyse different national cultures.

Answered: 1 week ago

Question

The nature of the issues associated with expatriate employment.

Answered: 1 week ago