



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CS 1321, Fall 2005 Exam 3 Friday, Dec 2, 2005
Your Name:
Signature:
TA’s Name:
INTEGRITY: By taking this exam, you pledge that this is your work and you have neither
given nor received inappropriate help during the taking of this exam in compliance with the
Academic Honor Code of Georgia Tech. Do NOT sign nor take this exam if you do not agree
with the honor code.
READ THIS: If your cell phone, pager, or beeper goes off during the exam, you will lose
10 points off this exam. Turn all such devices off and put them away now. You cannot have
them on the desk.
w
w
Print your GT email in the spaces provided to the left, and fill in the ovals of the corresponding numbers and letters.
Academic misconduct will not be tolerated. Penalties will be a zero on this exam, an F grade in the course, and/or other disci- plinary action.
Problem Points Possible Points Earned Points Lost Graded by
Bonus 5
TOTAL 100
one.) Anne, Bobby, Charles, Chris, Dennis, Guy, Matt, Peter.
file named ”numbers.txt” and will compute the average of all numbers found in that file. (Don’t worry about the path, just use that name hard-coded.) The function returns the average (be sure to make certain that you are calculating the float average of the numbers.) The file is guaranteed to have one number per line and the numbers might have a decimal point. (So again, be sure to make these act as floats.) You may assume that the file will have at least one number in it.
you have written. It will require only one method - a new constructor. The constructor for Square is to take one parameter, namely the length of a side. Inside the constructor though, go ahead and set a length and a width based on this one single length passed in. So in effect, a Square of size 5 is really storing the fact that the length and width are both 5. There is no need to rewrite the str or area methods.
returns the Boolean True if the number is equal to or greater than 70. The function returns False if the number is less than 70.
def isPassing(num):
Write a function called countPassingGrades that takes a list of numbers as a parameter and then finds the number of passing grades from the list. REQUIREMENTS: 1) Within the function use a call to the built-in function filter to get only the numbers that are indeed passing by using the function you just wrote called isPassing. After that filter step, 2) use whatever you like to figure out the count of numbers in the resultant array. Be sure to return the result.
Do not print anything. Use the provided header.
Example: countPassingGrades([100, 90, 29, 63, 0, 85]) should return 3 Example: countPassingGrades([13, 0, 20, 41]) should return 0
def countPassingGrades(array):