The university would like to remind students to pick-up their books at the bookstore if they choose not to have books delivered.Revise the program to reflect the following changes:Prompt the student f
Memo
To: | Troy Tuckett |
From: | |
Class: | PRG211 |
Date: | |
Re: | |
Initially the University required a website design that would prompt students to order at least five books. In addition, the students would then input the prices of the books and the program would return the total price of the books. However, the university has reassessed its needs and realized it is not necessary for students to take five classes. Therefore, the following program requires the student to input the number of courses they are taking and the program calculates the total price. Further, the website has been designed to facilitate delivery method where students have two options either to physically pick the documents or have the books shipped. Therefore, to solve the University’s problem, an algorithm is designed to define the steps that will be followed by the design.
Pseudo code for the program
Begin Program
Declare Integer Courses
Declare Integer number of Courses
Declare integer bookPrice
Declare string DeliveryCharges
Declare float TotalPrice
Declare string DeliveryStatus
Set Courses = 0
Set TotalPrice = 0
Set DeliveryCharges = 3.99
Display “Enter the number of courses being taken:”
Input number of Courses
While
Courses<numberofCourses
Display “What is the price of your book?”
Input bookPrice
Set TotalPrice = TotalPrice + bookPrice
Set Courses = Courses + 1
End While
//by the end of the while statement we have calculated the total price for the total number of books ordered
//To add shipping charges
Display “What mode of delivery do you prefer: Select 1 for shipping or 2 for pick-up?”
Input DeliveryStatus
If
DeliveryStatus = 1
Set DeliveryCharges = DeliveryCharges + TotalPrice
Display “Total price (inclusive of Delivery charges) is “DeliveryCharges”
Else
Display “Total Price is “TotalPrice”
End Program
Display “Enter number of courses taken
Input number of courses
Display “What is the price of the book”
Input bookPrice
Display “What mode of delivery do you prefer
I
Minimum Delivery Charges is 3.99
Display “Total Price is ‘TotalPrice’
f option 2 If option 1 Page 3