{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

IT 210 Week 5-Checkpoint - Simple Array Process

# IT 210 Week 5-Checkpoint - Simple Array Process -...

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

IT/210 CheckPoint: Simple Array Process Chapter 6 / Exercise 3 Input a list of employee names and salaries, and determine the mean (average) salary as well as the number of salaries above and below the mean. Define n to store number of employees Output “Enter the number of employees:” Input n Define namearray[n] Define salaryarray[n] Define sum_salary to store running sum of salaries Set sum_salary = 0 Define loop_integer Set loop_integer = 1 While (loop_integer – 1 < n) Output “Enter the name of employee” loop_integer Input namearray[loop_integer – 1] Output “Enter the salary of employee” loop_integer Input salaryarray[loop_integer – 1] Add salaryarray[loop_integer – 1] to sum_salary Increase loop_integer by 1 End while Define mean_salary to store mean salary of employees

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: mean_salary = sum_salary / n Output “The mean salary is” mean_salary Define count_below to store the number of salaries below the mean salary Set count_below = 0 IT/210 CheckPoint: Simple Array Process Define count_above to store the number of salaries above the mean salary Set count_above = 0 Set loop_integer = 1 While (loop_integer – 1 < n) If (salaryarray[loop_integer – 1] < mean_salary) Increase count_below by 1 Else if (salaryarray[loop_integer – 1] > mean_salary) Increase count_above by 1 End if End while Output “The number of salaries below the mean salary is” count_below Output “The number of salaries above the mean salary is” count_above...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

IT 210 Week 5-Checkpoint - Simple Array Process -...

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

View Full Document
Ask a homework question - tutors are online