
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
النسخة 7الرقم المعياري الدولي: 1285225562
Programming Logic and Design, Introductory 7th Edition by Joyce Farrell
النسخة 7الرقم المعياري الدولي: 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.
الخطوة 1 من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
الخطوة 2 من 2
لماذا لم يعجبك هذا التمرين؟
أخرى