The university updated its website program design request with a few more features to fit its needs.Update the website program to reflect the following changes:Use an array to prompt the user to enter


MThe university updated its website program design request with a few more features to fit its needs.Update the website program to reflect the following changes:Use an array to prompt the user to enter 1emo

To:


From:


Class:

PRG211

Date:


Re:

Individual Assignment for Week 4

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

  1. Declare string shippingOption

  2. Declare float totalPrice

  3. Declare float bookPrice

  4. Declare Integer numberOfCourses

  5. Declare float shippingCharges

  6. Declare Object shippingDate

  7. Display “Enter number of courses being taken”

  8. Input numberOfCourses

  9. FOR courses counter is less than or equal to numberOfCourses

  1. Display “Enter the price of each book?”

  2. Input bookPrice

  3. Set totalPrice = totalPrice + bookPrice[courses]

  4. Display totalPrice

  1. END FOR

  2. Display “Enter Shipping Options (Either Delivery or Pick up)”

  3. Input shippingOption

  4. IF shippingOptions is equal to “delivery” and shippingCharges greater than 0

Set totalPrice = totalPrice + shippingCharges

Display totalPrice “ and “ shippingDate

  1. ELSE IF shippingOptions is equal to “pickup” and shippingCharges equal 0

Display totalPrice

Display “Books can be picked up at the store

  1. ELSE

Display “No such shipping option; enter either delivery or pickup”

  1. End program

//by the end of the for loop, we have calculated the total price of the books














Display “Enter number of courses taken” and Input





FALSE



T

Input price of each book (bookPrice) and calculate total price (totalPrice)

RUE


Display total price (totalPrice)



Display shipping options







Pick up Delivery








Add shippingCharges to totalPrice. Display totalPrice







Display totalPrice and message of pickup at bookstore







 Page 4