# It 210 Simple Array

Submitted by: Submitted by

Views: 1837

Words: 357

Pages: 2

Category: Science and Technology

Date Submitted: 06/24/2011 08:10 PM

Report This Essay

CheckPoint: Simple Array Process

David Sauerbrei

IT/210

Leon Stevens

Axia College of University of Phoenix

Analysis

Process:

1. Prompt user to enter positive numbers between 1-100 into array

2. Prompt user to enter 0 when done

3. Prompt program to not store 0

4. List numbers using bubble sort

5. List first number as smallest

6. List last number as largest

7. List results

Input:

Prompt for Numbers (integer: numbers 1-100)

Output:

Smallest_Number (integer: number 1-100)

Largest_Number       (integer: number 1-100)

Design

Main Module

Declare Employee_Names[100] as string

Declare Salaries[100] as string

Declare Average as real

Declare K as integer

Declare Sum as integer

Write, “The Average Salary Computation Program.”

Write, “This program enables the user to compute the average salary,”

“of an employee and the number of salaries above and below that average.”

Call Input Data Module

Call Average Salary Module

Call Salaries Above and Below Average Module

Call Print Results Module

End Program

End Main Module

Input Data Module

Write, “Type the name of an employee followed by the salary of this employee.”

Input Employee_Name and Salary

Write, “Enter, 0 when done with program.”

Set Sum = 0

Set K = 1

While Names [K]

Input Names [K]

Input Salaries[K]

Set Sum = Sum + Salaries[K]

Set K = K + 1

End While

Call Average Salary Module

End Input Data Module

Average Salary Module

Set Average = Sum / K

Write “You have “, K, “Employees.” “Their total salary is,” Sum

Write “The average salary of your employees is,” Average

Call Salaries Above and Below Average Module

End Average Salary Module

Salaries Above and Below Average Module

Declare X as integer

Declare Count as integer

Declare Count2 as integer

Set Count = 0

Set Count2 =...