Simple Array Process - Declare X [100] Set Sum = 0 Set...

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

View Full Document Right Arrow Icon
Open “SALARIES” For Output as New File Write “Enter the employee’s name and salary.” Write “Enter 0 for both when done.” Input Employee, Salary While Employee <> “0” Write New File, Employee, Salary Write “Enter the employee’s name and salary.” Write “Enter 0 for both when done.” Input Employee, Salary End While Close New File Open SALARIES to read Open “SALARIES” For Input as Salary File While Not EOF (Salary File) Read Salary File, Employee, Salary Write Name, “ ”, Salary End While Close Salary File Do math
Background image of page 1

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

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

Unformatted text preview: Declare X [100] Set Sum = 0 Set Count1 = 0 While Salary <> 0 Set Count1 = Count1 + 1 Set X [Count1] = Num Set Sum = Sum + Num End While Set Average = Sum / Count1 Set Count2 = 0 Set Count3 = 0 For K = 1 Step 1 To Count1 If X [K] > Average Then Set Count2 = Count2 + 1 If X [K] < Average Then Set Count3 = count3 + 1 End If End For Display Results Write The average is: Average Write The number of items above the average is: , Count2 Write The number of items above the average is: , Count3...
View Full Document

This note was uploaded on 11/29/2011 for the course IT210 IT210 taught by Professor Hh during the Spring '10 term at University of Phoenix.

Page1 / 2

Simple Array Process - Declare X [100] Set Sum = 0 Set...

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

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