Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

They are asked for the number of points earned for the year, before this order and the number of books ordered this year, before this

They are asked for the number of points earned for the year, before this order and the number of books ordered this year, before this order. There are bonus points awarded based on the number of books previously ordered and number ordered now. These pointes should be added to the variable points:

(They are not asking for the user entering the number of books purchased for this order!)

Current order: 0 Previous Orders >10 Add 5 to point total

Current Order: 1,2, or 3 Previous Orders >10 Add 2 to point total

Current order: >3 Previous Orders >10 Add 15 to point total

Finish the pseudocode below:

// main main(): Module main () // Local variables Declare Integer points Declare Integer yearlyBooks Declare Integer books

// Get numbers Call getYearlyPoints(points) Call getYearlyBooks(yearlyBooks) Call getBooksPurchased(books)

// Display points earned If books == 0 Display "0 points earned this order" // Bonus check here Display Total points for the year, points Else If books == 1 Display "5 points earned this order" Set points = points + 5 // Bonus check here Display Total points for the year, points Else If books == 2 Display "15 points earned this order" Set points = points + 10 // Bonus check here Display Total points for the year, points Else If books == 3 Display "30 points earned this order" Set points = points + 15 // Bonus check here Display Total points for the year, points Else Display "60 points earned this order" Set points = points + 60 // Bonus check here Display Total points for the year, points End If End Module

// The getYearlyPoints module gets number of books purchased

// this year before this month

// and stores it in the number reference variable.

Module getYearlyPoints (Integer Ref number)

Display "How many points have you earned so far this year?"

Input number

End Module

// The getYearlyBooks module gets number of books purchased

// this year before this month

// and stores it in the number reference variable.

Module getYearlyBooks (Integer Ref number)

Display "How many books did you buy this year before this month?"

Input number

End Module

// The getBooksPurchased module gets number of books purchased

// this month

// and stores it in the number reference variable.

Module getBooksPurchased (Integer Ref number)

Display "How many books did you buy this month?"

Input number

End Module

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_2

Step: 3

blur-text-image_3

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions