Simple Array Process

Simple Array Process - Declare z as integer z[100 Declare...

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

View Full Document Right Arrow Icon
Simple Array Process Process Get user input other than zero Sort numbers using bubble sort Display smallest numbers Display largest numbers Input List or numbers as inters [1. .100] Output Display smallest number as integer Display largest number as integer Main Module Declare numbers as integer [100] Declare min Salary as integer Declare max Salary as integer Declare list Count as integer Declare enter Salary as integer Call Input Module Call Data Module Sort Number Module Call Min Module Call Max Module Call Results Module End Main Module Input Module Write “Please enter Salary as integer” Input number If salary = 0 Display “Wrong salary, please try again” End If Data Module Set list Count = 0 Set input Salary = 1 While list Count <=0 and input Salary <>0 Write “Enter Salary:” Input Salary
Background image of page 1

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

View Full Document Right Arrow Icon
If input Salary <>0 Set list Count = List Count + 1 Set Salary [list Count] = input Salary End if End While End Data Module Sort Number Module
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Declare z as integer z [100] Declare flag as integer Declare temp as integer Set flag = 0 Set count = 0 While flag = 0 Set flag =1 For z = 1 step 1 to Count If Salary[z] > Salary [z+1] then Set temp = Salary[z] Set Salary[z] = Salary [z+1] Set Salary [z+1] =temp Set flag = 0 End If End For End While End Sort Number Module Minimum Module If list Count => 1 then Min Salary = Salary [1] Else min Salary =0 End if End min Module Maximum Module If list Count =>1 and list Count<=100 then = max Salary [list Count] Else max Salary = 0 End If End Max Module Display Results If list Count => 1 then Write “The smallest Salary is:” Write min Salary, Write “The largest Salary is” Write max Salary, Else Write” No other Salary’s to display” End if Write “Do you want to run program again?, Y or N:” Input Response If response = Y then Call Input Module Else Write “End of salary calculator” End if End Program...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Simple Array Process - Declare z as integer z[100 Declare...

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

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