{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CheckPoint Week 5

# CheckPoint Week 5 - Define count_below to store the number...

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

CheckPoint Week 5 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 mean_salary = sum_salary / n Output “The mean salary is” mean_salary

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: Define count_below to store the number of salaries below the mean salary Set count_below = 0 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

CheckPoint Week 5 - Define count_below to store the number...

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

View Full Document
Ask a homework question - tutors are online