
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
Edition 7ISBN: 1285225562a. Design the logic for a program that allows a user to enter 15 numbers, then displays them in the reverse order of entry.
b. Modify the reverse-display program so that the user can enter any amount of numbers up to 15 until a sentinel value is entered.
Step 1 of 2
Flowchart that prints numbers in reverse order
b)
Program
Start
Declarations
num SIZE=15
num Numbers[15]
num index=0
housekeeping()
while index
InputElements()
if value!=sentinel
Numbers[Index]=value
Index=Index+1
endif
endwhile
Index=SIZE-1
while index>=0
OutputElements()
endwhile
finish()
stop
housekeeping()
Output “Enter Values”
return
InputElements()
Input Value
Index=Index+1
return
OutputElements()
output Numbers[Index]
Index=Index-1
return
finish()
output “End of job”
return
Step 2 of 2
Why don’t you like this exercise?
Other