Help with my programming homework (python, and raptor)

Denis McMahon denismfmcmahon at gmail.com
Wed Nov 6 21:13:53 EST 2013


On Wed, 06 Nov 2013 16:56:26 -0800, jonny seelye wrote:

> Since the name of the employee will be a string and the
> salary will be a number, you decide to use two parallel 
> arrays to store the data.

The hell I do! I decide to do this:

# data initialisation

minsal = maxsal = sumsal = 0.0
minpers = []
maxpers = []

# employee and salary input processing

get the number of employees
check the number is > 0

for 1 to number of employees
	get the name
	get the salary

	if minsal == 0.0
		note minsal
		set the minpers list to name
	else if salary < minsal
		note minsal
		set the minpers list to name
	else if salary == minsal
		append name to the minpers list

	similar for maxsal & maxpers

	sumsal += salary

# outputs

average salary = # calculate

maximum salary = 
people receiving = 

similar for minimum

I might have missed something from the original spec, but as I recall, 
you just wanted min, max and avg salaries, and to know who was getting 
the min and max, yes?

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list