CS Python questions
CS21 Assignment #8
1. (charge_accts.py) Complete Programming Exercise #5 on page 403 in your textbook. You may read the data from the
file, into the list using a loop or explore the readlines() method in your book.
2. (drivers.py) Complete Programming Exercise #7 on page 403 in your textbook. Name your test file
“student_solution.txt”.
3. (winners.py) Complete Programming Exercise #10 on page 404 your textbook.
Challenge : If you’re done and have more time… and would like a challenge, modify #3 to also output the years the
specified team won the World Series. [Not required, no extra credit… just the opportunity to code more and challenge
yourself]
It is expected that you will use exception handling and error handing to ensure your programs are robust and will not
crash.
Reminders (not following will result in point deductions):
If a function’s task doesn’t include output to the user, do not do it!
All programs should have a main() function
Use constants! No magic numbers! No global variables!
It is expected that you will complete the same process of development that we use in class. When you reach the point
of having an algorithm (pseudocode), this will become the comments of your program as a starting point for writing
code. Comment first, then code!
Be sure to include comments at the top of the program that include your name, class and a short description of the
program.
Each function should begin with a comment describing the task the function will perform.
Be sure all output is formatted. Unless otherwise, specified, displays non-integer values with 2 digits after the decimal
point.
Any work you submit for this assignment should be authored entirely by yourself. Assistance is permitted from the
instructor or teaching assistants only. All submitted programming assignments are subject to originality verification
through software designed and used for the Measure Of Software Similarity (MOSS).