Simple Array Process

Simple Array Process - Set listCount = 0 Set inputNum = 1...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Maxine L. Cruz IT210 Casandra Richardson Simple Array Process Process : 1. Prompt user to enter integer numbers other than 0, with a maximum of 100 2. Prompt user to enter 0 when he or she wants to end 3. Do not save zero. 4. Print the first element as the smallest number. 5. Print the last element as the largest number. Input: List of numbers (integer: Numbers[1. .100]) Output: Smallest number (integer: minNum) Largest number (integer: maxNum) Pseudocode Main Module Declare Numbers as integers Declare minNum as integer Declare maxNum as integer Declare listCount as integer
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Declare inputNum as integer Call Input Data Module Call Sort Numbers Module Call Find Minimum Module Call Find Maximum Module Call Print Results Module End Main Module Input Data Module Display “Please enter integer numbers other than 0” Display “Enter 0 to stop processing numbers”
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Set listCount = 0 Set inputNum = 1 While listCount <= 100 AND inputNum <> 0 Display Enter Number: Read inputNum if inputNum <> 0 Set listCount = listCount + 1 Set Numbers[listCount] = inputNum end if end while End Data Module Find Minimum Module if listCount >= 1 then minNum=Numbers else minNum=0 end if End Find Minimum Module Find Maximum Module if listCount > =1 AND listCount <= 100 then maxNum = Numbers[listCount] else maxNum = 0 end if End Find Maximum Module Print Results Module if listCount >= 1 then Display The smallest number is: Write minNum Display The largest number is: Write maxNum else Display There are no numbers in the list end if End Print Results Module...
View Full Document

This note was uploaded on 08/28/2011 for the course IT 210 taught by Professor Josephpillera during the Summer '10 term at University of Phoenix.

Page1 / 4

Simple Array Process - Set listCount = 0 Set inputNum = 1...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online