subject

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 or not it has been used before. 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 the 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 up 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:
Enter book number: 0755798652
Enter price per copy: 34.98
Enter expected class enrollment: 35
Enter 'R' if required or 'S' if suggested: r
Enter 'N' if new or 'O' if not a new text: O
ISBN: 0755798652
Copies Needed: 23
Profit: $ 160.91
TEST DATA
0755798652,34.98,35,R, O
3453456784,23.95,100,R, N
5677655673,54.50,40,R, O
2462462464,5.95,40,S, O
8953647888, 65.99, 35, N, Y

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 16:50, Tyrant4life
Consider a slotted aloha system, where the time slot equals the fixed duration of each packet. assume that there are 4 stations a, b,c, d sharing the medium. (a) stations a, b,c, d receive one packet each from higher layers at times 1.3, 1.5, 2.6,5.7 respectively. show which transmissions take place when, according to the slottedaloha protocol; describe all transmissions until all four packets have been successful. when needed, each station has access to the following sequence of random number, provided by a random number generator and drawn uniformly between 0 and 1: (1) station a draws numbers: 0.31, 0.27, 0.78, 0.9, 0.9, 0.11, 0. (2) station b draws numbers: 0.45, 0.28, 0.11, 0.83, 0.37, 0.22, 0. (3)station c draws numbers: 0.1, 0.2, 0.3, 0.4, 0. (4) station d draws numbers: 0.36, 0.77, 0.9, 0.1, 0.1, 0.1, 0.1, 0. (b) in slotted aloha, a station transmits in each time slot with a given probability. what probabilities would you assign to each of the four stations so as to: (i) maximize the efficiency of the protocol? (ii) maximize fairness among the four stations? (c) will the efficiency increase or decrease if we modify slotted aloha as follows: (i) get rid of slots and allow stations to transmit immediately? (ii) implement carrier sensing? (iii) implement collision detection? (iv) implement collision avoidance?
Answers: 3
image
Computers and Technology, 23.06.2019 00:00, addisonrausch
What season was better from fortnite?
Answers: 2
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
image
Computers and Technology, 24.06.2019 09:50, potatocow
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
Answers: 1
You know the right answer?
Write a C++ program to aid the DeAnza Bookstore in estimating its business for next quarter. Experie...

Questions in other subjects:

Konu
Biology, 26.10.2020 23:20
Konu
Mathematics, 26.10.2020 23:20
Konu
Mathematics, 26.10.2020 23:20