Simple Array Process

# Simple Array Process - Set Sum = 0 Set Count1 = 0 While...

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

Open “SALARIES” For Output As NewFile Write “Enter the employee’s name and salary.” Write “Enter 0 for both when done.” Input Employee, Salary While Employee <> “0” Write NewFile, Employee, Salary Write “Enter the employee’s name and salary.” Write “Enter 0 for both when done.” Input Employee, Salary End While Close NewFile Open SALARIES to read Open “SALARIES” For Input As SalaryFile While Not EOF(SalaryFile) Read SalaryFile, Employee, Salary Write Name, “ ”, Salary End While Close SalaryFile Do math Declare X[100]

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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 04/03/2011 for the course IT 210 taught by Professor Josephpillera during the Spring '10 term at University of Phoenix.

### Page1 / 2

Simple Array Process - Set Sum = 0 Set Count1 = 0 While...

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

View Full Document
Ask a homework question - tutors are online