Error message

  • User warning: The following module is missing from the file system: pantheon_api. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /home/novelguides/homeworkhelp.novelguide.com/includes/bootstrap.inc).
  • User warning: The following module is missing from the file system: pantheon_login. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /home/novelguides/homeworkhelp.novelguide.com/includes/bootstrap.inc).
  • User warning: The following module is missing from the file system: pantheon. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /home/novelguides/homeworkhelp.novelguide.com/includes/bootstrap.inc).

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

0
No votes yet
Reputation: 18
Asked 4 years ago.
502 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.