University Project: Using Selection and Iteration II
Running head: SELECTION AND ITERATION 1
SELECTION AND ITERATION 4
Selection and Iteration
Megan Abeyta
University of Phoenix
PRG/211
June 18, 2018
Pseudocode logic
Dim bookcost As Integer
Dim totalcost As Integer
Dim Courses As Integer
Dim numberOfCourses as Integer
Declare Deliverycost as Integer
Courses = 0
totalcost = 0
Deliverycost = 3.24
Output “Input the number of courses” Input numberofcourses // While loop, While Courses < numberofcourses Output “The cost of your book” Input bookcost Get totalcost = totalcost + bookcost Get Courses = Courses + 1
End While
// Here you output the total bookcost. Output “totalcost of books”, bookcost.
// Delivery statement to output “Delivery/pick-up (True/False)” Input Deliverymode If Deliverymode == “True” Then totalcost = totalcost + Deliverycost
EndIF
Output “Overall bookcost: “, totalcost
Flow Chart Logic
T
F
T
F
REFERENCES
Gaddis, T. (2019). Starting out with programming logic and design. NY: Pearson
Neapolitan, R. E., & Naimipour, K. (2004). Foundations of algorithms using C++ pseudocode. Sudbury (Massachusetts: Jones and Bartlett Publishers.
|
|
|
|
Totalcost = 0
Courses = 0
Output “Input the no of courses”
Output “Overall cost” Totalcost
Output “Delivery/Pick-up
True/False"
DeliveryMode
Output “Cost of the book”
Coureses < No of courses
DeliveryMode = True
End
Totalcost = Totalcost + bookcost
Courses = courses + 0
Totalcost = Totalcost + Deliverycost
Start