Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

working in c++, i have to create a bookstore program that allows a user to buy a number of books. Shown in the code above,

image text in transcribed

working in c++, i have to create a bookstore program that allows a user to buy a number of books. Shown in the code above, the customer is asked to enter the cost of the book, whether it's a hard copy, if they want a discount and then they can choose to enter "c" to check out another book (and hence restart the loop) or press any other key and this will print a order report (the part immediantly after the while loop). If they choose to check out another book the integer "checkedOut" is incremented and the loop restarts.

The loop doesn't seem to work though, any suggestions as to why? thanks!

while ((actionl -- c (actioni -- )) cout"customer 1. ation; if (action .. .h" Il action .. .. totali (cost5): else totali (cst2): cout"enter \"d\" if custoner recieves a discount. any other key if they don't:" endl; cin acticn; if (action d) totalz (totall (tctali-.1)) else totalz totali; cout

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

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions