Week 5 checkpoint Simply Array Process

Week 5 checkpoint Simply Array Process - Output the nmean...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Week 5 checkpoint Simply Array Process Main Module Define n to store number of employees Output – enter the number of employees- Input n Def namearray “n” Def salaryarary “n” Def sum_salary this stores running sum of salaries Set sum_salary = 0 Def – loop_integer Set loop_integer While (loop_integer – 1<n) Output “ enter employee name “ loop_integer Input namearray ( loop_intege – 1) Add salaryarray ( loop_integer – 1) to sum_salary Add loop_integer +1 End While Def mean_salary stores mean salary of employee Mean_salary = sum_salary – n
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Output the nmean salary is mean_salary Def count_below stores number of salaries < the mean salary Set count_below = 0 Def count_above stores number of salaries > mean salary Set loop_integer =1 While ( loop_integer -1<n) If (salaryarray[loop_integer 1] < mean_salary) Increase count_below by 1 Else (salaryarray[loop_integer 1]>mean_salary) Increase count_above +1 End if End while Output number of salaries below mean salary is count_below Output number of salaries above mean salaryis count_above...
View Full Document

This note was uploaded on 11/07/2011 for the course IT 240 242 taught by Professor Some during the Spring '10 term at University of Phoenix.

Ask a homework question - tutors are online