About PLD provide a pseudo code to design an application tha
About PLD provide a pseudo code to design an application that accepts 10 numbers and displays them in descending order.
Solution
Answer:
start
Declarations
num SIZE = 10
num numbers[SIZE]
num input1
num input2
num read
num COMPS = SIZE - 1
completeArray()
arrangeArray()
showArray()
stop
completeArray()
input1 = 0
while
input1 < SIZE
output “Enter a number”
input numbers[input1]
input1 = input1 + 1
endwhile
return
arrangeArray()
input1 = 0
input2 = 0
while input2 < COMPS
input1 = 0
while input1 < COMPS
if numbers[input1] > numbers[input1 + 1] then
swap()
endif
input1 = input1 + 1
endwhile
input2 = input2 + 1
endwhile
return
swap()
read = numbers[input1+1]
numbers[input1+1] = numbers[input1]
numbers[input1] = read
return
showArray()
input1 = SIZE - 1
while input1 >= 0
output numbers[input1]
input1 = input1 - 1
endwhile
return
