Đã Hủy

C++ Book Sales Calculator

Assignment: Write a program (Book Sale Calculator) that accepts all input from an external data file and displays a summary for each book sale. The program needs to open the external data file ([url removed, login to view]) and continue to read in data until the end of the file is reached. No sentinel value can be used to signal termination, and you cannot count the number of items in the file or use a count controlled loop to obtain the data. The data file is stored so that the number of books in each sale and the single character code for shipping (S = Standard which is [url removed, login to view] and E for Expedited is [url removed, login to view]) representing the shipping method is on one line, and the prices for all of the books are on the second line.

Create four functions for the following:

(1) Obtain the name of the data file and attempt to open it for reading. If the attempt to open the file fails, the program should report an appropriate error message and quit.

(2) Obtain all input for each sale from the data file. This function should return the merchandise subtotal and shipping method for the current sale being processed.

(3) Calculate all taxes and discounts.

(4) Display a final summary for each sale.

The sales tax is .05%

Discounts are as follows:

* If the subtotal is < $50, there is no discount

* If the subtotal is between $50-$100, the discount is 10%

* If the subtotal is above $100, the discount is 15%

Additionally, no global variables can be used and all information must be shared between functions via parameters and return values. The main function should consist of variable declarations, function calls, and a control loop for reading each sale from the file can be there.

The external data file name ([url removed, login to view]) consists of the following format:

5 S

[url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view]

1 E

[url removed, login to view]

3 E

[url removed, login to view] [url removed, login to view] [url removed, login to view]

7 S

[url removed, login to view] [url removed, login to view] [url removed, login to view] 40 [url removed, login to view] [url removed, login to view] [url removed, login to view]

****A sample output of the program:****

The summary for order #1 is as follows:

Subtotal: [url removed, login to view]

Tax: [url removed, login to view]

Discount: [url removed, login to view]

Shipping: [url removed, login to view]

Total: [url removed, login to view]

The summary for order #2 is as follows:

Subtotal: [url removed, login to view]

Tax: [url removed, login to view]

Discount: [url removed, login to view]

Shipping: [url removed, login to view]

Total:[url removed, login to view]

The summary for order #3 is as follows:

Subtotal: [url removed, login to view]

Tax: [url removed, login to view]

Discount: [url removed, login to view]

Shipping: [url removed, login to view]

Total: [url removed, login to view]

The summary for order #4 is as follows:

Subtotal: [url removed, login to view]

Tax: [url removed, login to view]

Discount: [url removed, login to view]

Shipping: [url removed, login to view]

Total: [url removed, login to view]

Thanks for shopping with us. Come again!

Kỹ năng: Lập trình C++

Xem thêm: book sale, sales book program, sales calculator program, program book sale, program book sales, variables programming, variable programming, used write book, standard programming, shared variable, programming variables, programming variable, must read programming books, method write report, loop programming, programming input output, programming loop, programming continue, programming books, programming book, control programming, continue line, calculator programming, books programming, summary books

Về Bên Thuê:
( 0 nhận xét ) New Hope, United States

Mã Dự Án: #1034202

23 freelancer đang chào giá trung bình $35 cho công việc này

VileGnosis

Details in PMB

$30 USD trong 1 ngày
(112 Đánh Giá)
6.4
deadhunt

Please check PMB.

$30 USD trong 0 ngày
(35 Đánh Giá)
5.3
Murzka

Can be done!

$30 USD trong 0 ngày
(12 Đánh Giá)
5.2
it2051229

Hi kindly check your inbox for my inquiries. Thanks.

$30 USD trong 0 ngày
(52 Đánh Giá)
4.8
thanhhungqb

Please see pmb, thanks.

$30 USD trong 0 ngày
(26 Đánh Giá)
4.1
Algotrade

Please see your PM

$30 USD trong 2 ngày
(13 Đánh Giá)
4.1
gelo76

Please check PM

$30 USD trong 0 ngày
(3 Đánh Giá)
4.1
ansaryfantastic

Please see your inbox.

$30 USD trong 0 ngày
(10 Đánh Giá)
3.3
siamsoft061

sir, ready to work. waiting your reply. Thank you

$30 USD trong 0 ngày
(5 Đánh Giá)
3.2
bluetomato

Please see pm

$30 USD trong 1 ngày
(1 Đánh Giá)
1.7
Dutchstudent7750

Can finish this today. Feel free to have a look at my profile.

$30 USD trong 0 ngày
(1 Đánh Giá)
1.4
ManOpera

I can do it in one hour ... just let me know if you ready to start!

$70 USD trong 1 ngày
(1 Đánh Giá)
1.4
dtrane

Please check PMB, thanks!

$50 USD trong 1 ngày
(0 Đánh Giá)
0.0
ferbrice

I'm C programmer, i can do it.

$40 USD trong 2 ngày
(0 Đánh Giá)
0.0
VikashThecoder

Please check your PMB

$40 USD trong 1 ngày
(0 Đánh Giá)
1.0
topcoder0

I can do it

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0
$30 USD trong 1 ngày
(0 Đánh Giá)
0.0
ShubhabrataKarma

I can do it.

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0
mudassiranjum

Please check the PM.

$75 USD trong 0 ngày
(0 Đánh Giá)
0.0
cmahen

please check PM

$30 USD trong 1 ngày
(0 Đánh Giá)
0.0