Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program to aid the Bookstore in estimating its business for next quarter. Experience has shown that sales depend on whether a book

Write a C++ program to aid the Bookstore in estimating its business for next quarter. Experience has shown that sales depend on whether a book is required or suggested, and on whether it has been used as a text during a previous quarter or if this is the first time it has neen ordered by a faculty member. A new, required book will sell to 90% (.90) of expected enrollment, but if it has been used before only 65% of the expected enrollment will buy it. Similarly, 40% of the expected enrollment will buy a newly suggested book, but only 20% will purchase a previously suggested book. INPUT Your program is to prompt the user for: - the book's 10 digit ISBN number (store as a string) - the list price per copy - the expected class enrollment - code of 'R'for required text or code of 'S' for suggested text - code of 'N' for a new text or code of 'O' for a text that has been used in a previous quarter CALCULATE Calculate the number of copies needed and the profit if the store pays 80% of list (use global define for this). For the number of books to order, round to the nearest whole book.Use one function to calculate number of books, one function to calculate the profit, and one function to output.

Checkpoints 1) Include name, e-mail, and lab# as comment andprint same to output 2) Minimum of three (3) comments in each function (Purpose: Pre: Post:) 3) Use a globally defined constant for the rate of profit 4) Input may not be case sensitive. That is, if user enters r change it to R immediately. To do this use if() and assign uppercase value or you may use toupper() function. Only an error message should be output and nothing more if data is erroneous. Use exit() function 5) A function must be used to calculate the number of books to be ordered. Round to the nearest whole number. Hint: static_cast (x + .5) 6) A function must be used to calculate the profit given the number of books and unit price. 7) One function must be used for all the output 8) Output must be formatted using dollar sign and 2 decimal place as shown on page 1.

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

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions