Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased every month, The points are awarded as follows  1.If a customer purchases 0 books, he or she earns points 0 If a customer purchases 1 books, he or she earns points 5 If a customer purchases 2 books, he or she earns 15 points If a customer purchases 3 books, he or she earns 30 points If a customer purchases 4 or more books he or she earns 60 points   Design a program using pseudocode that asks the user to enter the number of books that he or she has purchased this month and displays the number of points awarded .    Here are some necessary parameters to follow to help solve the problem. Please write line numbers before each line of the algorithm, include blank numbered lines between modules and write comments 1.Create a main module. It should declare one local variable and call two other modules  2. Create a module to get input from the software user  3.Create a module to print out the answer.  **example of desired format is attatched

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section: Chapter Questions
Problem 9PP
icon
Related questions
Question
100%

Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased every month, The points are awarded as follows 

1.If a customer purchases 0 books, he or she earns points 0

If a customer purchases 1 books, he or she earns points 5

If a customer purchases 2 books, he or she earns 15 points

If a customer purchases 3 books, he or she earns 30 points

If a customer purchases 4 or more books he or she earns 60 points

 

Design a program using pseudocode that asks the user to enter the number of books that he or she has purchased this month and displays the number of points awarded .

 

 Here are some necessary parameters to follow to help solve the problem. Please write line numbers before each line of the algorithm, include blank numbered lines between modules and write comments

1.Create a main module. It should declare one local variable and call two other modules 

2. Create a module to get input from the software user 

3.Create a module to print out the answer. 

**example of desired format is attatched 

Get live help whenever you need from online tutors! Try bartleby tutor today >
Pseudocode:
1. //function to get input and return the user input
2. getinput():
3. Input mass
4.
return mass
5. End getinput
6. //function to calculate weight and return the weight
7. calculateWeight(Real mass, constant, weight):
8. weight = mass ' constant
9. return weight
10. End calculateWeight
11. //function to display the result
showResult(weight):
13. Output "Weight is:", weight
12.
14. End showResult
15. //main function
16. main()
Declare Real mass, weight,constant
17.
18. Assign constant = 9.8
Assign mass = getinput()
20. If mass > 1000:
19.
21.
Output "Object is too heavy"
22.
Else If mass < 10:
23.
Output "Object is too light"
24.
Else:
25.
weight = calculateWeight(mass,constant,weight)
26.
End If
27. showResult(weight)
28. End main
Explore similar questions
Transcribed Image Text:Get live help whenever you need from online tutors! Try bartleby tutor today > Pseudocode: 1. //function to get input and return the user input 2. getinput(): 3. Input mass 4. return mass 5. End getinput 6. //function to calculate weight and return the weight 7. calculateWeight(Real mass, constant, weight): 8. weight = mass ' constant 9. return weight 10. End calculateWeight 11. //function to display the result showResult(weight): 13. Output "Weight is:", weight 12. 14. End showResult 15. //main function 16. main() Declare Real mass, weight,constant 17. 18. Assign constant = 9.8 Assign mass = getinput() 20. If mass > 1000: 19. 21. Output "Object is too heavy" 22. Else If mass < 10: 23. Output "Object is too light" 24. Else: 25. weight = calculateWeight(mass,constant,weight) 26. End If 27. showResult(weight) 28. End main Explore similar questions
Expert Solution
Step 1 - Analysis

As per the given problem, we have to design a pseudocode that displays the number of points earned which is calculated on the basis of number of books purchased.

If Books Purchased == 0, points earned is 0,

If Books Purchased == 1 points earned is 5,

If Books Purchased == 2, points earned is 15,

If Books Purchased == 3, points earned is 30,

If Books Purchased >= 4, points earned is 60,

Modules required :

1. Main module.

2. Module to take input from user

3. Module to print the answer.

The required pseudo-code is implemented below as required.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr