Question: Write a C++program to aid the DeAnza 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 DeAnza 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 quarteror if thisis 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 aprevious quarterCALCULATECalculate 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. OUTPUT A sample run might look like this:Sample Run 1Enter book number: 0755798652Enter price per copy: 34.98Enter expected class enrollment: 35Enter 'R' if required or 'S' if suggested: rEnter 'N' if new or 'O' if not a new text: OISBN: 0755798652Copies Needed:23Profit: $ 160.91Sample Run 2Enter book number: 0755798652Enter price per copy: 34.98Enter expected class enrollment: 34Enter 'R' if required or 'S' if suggested: rEnter 'N' if new or 'O' if not a new text: OISBN: 0755798652Copies Needed:22Profit: $ 153.91 2TEST DATA0755798652,34.98,35,R,O0755798652,34.98,34,R,O2462462464,5.95,40,S,O8953647888, 65.99, 35, N, YTHEME ISSUESFunctions (pass by value), IF Control Structures, character type, rounding

Checkpoints Absolutely no global variable declarations. All variables must be declared within a function such as main().

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 (see 10.2 on page 545 of text). Only an error message should be output and nothing more if data is erroneous. Use exit() function as explained in 6.15 (p. 360).

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.

TEST DATA

0755798652,34.98,35,R,O

0755798652,34.98,34,R,O

2462462464,5.95,40,S,O

8953647888, 65.99, 35, N, Y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!