Date: Mon, 11 Nov 1996 17:57:22 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Tue, 30 Apr 1996 23:02:58 GMT Content-length: 6953
then your program should display (hint: use this to check your results)
To count the number of primes go through the array and for each number check to see if it is a prime number or not; i.e. see if any value besides 1 and the number itself evenly divides into it. If the number turns out to be prime then increment a counter accordingly.
To determine if the list of numbers is in strictly ascending or descending order, go through each pair of numbers in the array. If the second number is greater than or equal to the first then the list must necessarily not be in descending order. If the second number is less than or equal to the first then the list must necessarily not be in ascending order. Not: it only takes one pair of numbers in the wrong order to make the whole list not ascending/descending.
I suggest writing the MINMAX function first because it is the easiest, then PRIME which is a little harder, and finally UPDOWN because it requires the most thought. Once you have debugged each function/subroutine and got it working then move on to the next one. Don't attempt to write everything and debug it all at once; instead do it one piece at a time. This one of the biggest advantages of writing user-defined functions and subroutines!
Correct Output [20] 5,11,20,31,44,60,79,99,123,148 [5] 148,123,99,79,60,44,31,20,11,5 [5] 10,73,-32,34,86,27,36,-1,2,92 [5] 55,99,34,-8,52,28,-44,17,50,86 [5] User Interface [4] Useful prompts for each number [2] Meaningful display of results [2] Implementation [18] Correct use of functions, subroutines and arguments [4] Correct use of arrays [4] Correct use of IF/THEN/ELSE/END IF statement [3] Correct use of DO/END DO loop [3] Meaningful variable names [2] Indenting and neatness [2] Documentation [8] Program description [3] Function and subroutine descriptions [3] Variable and argument definitions [2] __________________________________________________________ Total (25%) [50]