We are about to switch to a new forum software. Until then we have removed the registration on this forum.
complete the function isAscending that when passed an array of floating-point numbers, returns true if the array is sorted in ascending order (such that each item is less than or equal to the next item), and false otherwise.
boolean isAscending(float[] a) {
...
}
Answers
sigh. complete answers to homework questions.
complete answers to homework questions WHEN SHE ONLY ASKED FOR CLARIFICATION.
marissa,
i think you are expected to write code, using the supplied method signature, that tests to make sure the supplied list of number is in ascending order, ie that the second is bigger than the first, the third is bigger than the second etc.
you need a loop and a test. if a number is smaller (or equal) than the one before then you can return false immediately. if you reach the end of the list you can return true.
Thank you!! this really helped :)
https://forum.Processing.org/two/discussion/17237/can-someone-please-explain-this-question-for-me-and-how-the-answer-is-bill