Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58610 > unrolled thread
| Started by | jonny seelye <casioboy12@gmail.com> |
|---|---|
| First post | 2013-11-06 16:56 -0800 |
| Last post | 2013-11-07 02:13 +0000 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.lang.python
Help with my programming homework (python, and raptor) jonny seelye <casioboy12@gmail.com> - 2013-11-06 16:56 -0800
Re: Help with my programming homework (python, and raptor) Chris Angelico <rosuav@gmail.com> - 2013-11-07 12:07 +1100
Re: Help with my programming homework (python, and raptor) Alister <alister.ware@ntlworld.com> - 2013-11-07 10:14 +0000
Re: Help with my programming homework (python, and raptor) Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-07 02:13 +0000
| From | jonny seelye <casioboy12@gmail.com> |
|---|---|
| Date | 2013-11-06 16:56 -0800 |
| Subject | Help with my programming homework (python, and raptor) |
| Message-ID | <d8904015-8e4b-4bda-96aa-1222ac3cfbff@googlegroups.com> |
Employee Salaries You are working for a medium sized construction company as an intern in the Information Technology department. A director in the Human Resources department recently asked the IT department to write a small program that will help them do a salary comparison. The program needs to be able to enter the name of the employee and their salary. Once the data is loaded the program needs to find the average salary, the highest salary and the lowest salary. The program needs to print out these values along with the names of the employees that go along with the salary. Your boss, who has great trust in you and your programming abilities, has given this project to you. You, therefore, schedule a meeting with the HR director asking for the program to clarify the program’s requirements. After your meeting you have summarized the following: The program needs to ask for how many employees and salaries the program will be working with. The program needs to do some data validation on this number to make sure it is a positive number. The program needs to ask for the name of each employee along with their salary. 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 program will need to do some data validation on the salary to make sure it is a number and greater than 0 and less than $200,000. The program will determine what the average salary is and print that out to the user. The program will determine what salary is the lowest and print that out along with the name of the employee who has that salary figure. The program will determine what salary is the highest and print that out along with the name of the employee who has that salary figure. Use the following test data to test your program. Employee Name Salary John $45,600 Average Salary: $63, 862.50 Sue $55,400 Highest Salary: $89,750 David $64,700 Lowest Salary: $45,600 Betty $89,750
[toc] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-11-07 12:07 +1100 |
| Message-ID | <mailman.2108.1383786436.18130.python-list@python.org> |
| In reply to | #58610 |
On Thu, Nov 7, 2013 at 11:56 AM, jonny seelye <casioboy12@gmail.com> wrote: > Employee Salaries > Use the following test data to test your program. > Employee Name Salary > John $45,600 Average Salary: $63, 862.50 > Sue $55,400 Highest Salary: $89,750 > David $64,700 Lowest Salary: $45,600 > Betty $89,750 We're not a "do your homework for you" list. Start by writing as much as you can yourself, then figure out exactly where you're stuck and ask a specific question. We're happy to help you learn Python - that's the future of programming anyway - and so we will not help you to not-learn Python by getting someone else to do your work. Nobody here wants to turn you into a course-qualified but utterly incompetent programmer :) ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Alister <alister.ware@ntlworld.com> |
|---|---|
| Date | 2013-11-07 10:14 +0000 |
| Message-ID | <WJJeu.10243$Mn5.80@fx25.am4> |
| In reply to | #58613 |
On Thu, 07 Nov 2013 12:07:06 +1100, Chris Angelico wrote: > On Thu, Nov 7, 2013 at 11:56 AM, jonny seelye <casioboy12@gmail.com> > wrote: >> Employee Salaries Use the following test data to test your program. >> Employee Name Salary John $45,600 Average Salary: $63, >> 862.50 Sue $55,400 Highest Salary: $89,750 David $64,700 >> Lowest Salary: $45,600 Betty $89,750 > > We're not a "do your homework for you" list. Start by writing as much as > you can yourself, then figure out exactly where you're stuck and ask a > specific question. We're happy to help you learn Python - that's the > future of programming anyway - and so we will not help you to not-learn > Python by getting someone else to do your work. Nobody here wants to > turn you into a course-qualified but utterly incompetent programmer :) > > ChrisA If you are totally unsure where to start try blocking out the flow of the process in simple sentences & post that. we can then advise if the process is correct & suggest improvements. -- Lord, defend me from my friends; I can account for my enemies. -- Charles D'Hericault
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2013-11-07 02:13 +0000 |
| Message-ID | <l5et11$3i4$2@dont-email.me> |
| In reply to | #58610 |
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@gmail.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web