Create the logic for a program that reverse an array of numbers?

0
No votes yet
Reputation: 18
Asked 2 years ago.
394 View(s)
Create the logic for a program that reverse an array of numbers?

I'm having a little trouble with homework. I believe I have a solution to the problem, but I'd like to make sure. Here's the question.

"Create the logic for a program that prompts a user for ten numbers and stores them in an array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the main program."

Here's what I have so far:

Start
Declarations
NUM numbers[10]

for count = 0 to 9 step 1
input numbers[x]
endfor
reverseArray(numbers[x])
for count = 0 to 9 step 1
output nums[x]
endfor
Stop

reverseArray(NUM nums[x])
Declarations
NUM nums[10]
for count = 0 to 9 step 1
if nums[x] > nums[x + 1]
Swap()
endif
nums[x] = nums[x + 1]
endfor
return nums[x]

Delivery Time: 1 days.
Question Category: Programming.
Shen Smith
Reputation: 99
Free
Deliver in: 3 days

Tutor Answer

You must be login to view answer.