1.

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. Declare Salary (5)(1) as string Declare Salary (5)(2) as integer Declare Salary Average as integer Declare Count as integer Salary(1)(1) = Becky Hamilton Salary(1)(2) = 54,787 Salary(2)(1) = Robert Milton Salary(2)(2) = 63, 284 Salary(3)(1) = Alex Smith Salary(3)(2) = 65,197 Salary(4)(1) = Dan Johnson Salary(4)(2) = 72,468 Salary(5)(1) = Sharon Williams Salary(5)(2) = 55,633 Declare A as string Declare B as integer Set Salary Average = “Salary(1)(2)”+”Salary(2)(2)”+”Salary(3)(2)”+”Salary(4)(2)”+ “Salary(4)(2)”

Input Num Set Count1 = Count1 + 1 Set Salary Average[Count1] = Num Set Sum = Sum + Num Write “Enter another number or 0 to quit: ” Input Num End While Set Average = Sum / Count1 Set Count2 = 0 For K = 1 Step 1 To Count1 If Salary Average[K] > Average Then Set Count2 = Count2 + 1 End If End For Write “The average is:”, Average Write “The number of items above the average is: ”, Count2

Sign up to vote on this title
UsefulNot useful