Question
In Python: Code to follow q5-grades.py: # Read from a file with student scores. # Each line has: # Course number, Student ID, Score (score
In Python:
Code to follow q5-grades.py:
# Read from a file with student scores. # Each line has: # Course number, Student ID, Score (score is an int, 0 through 100).
# Your goal: Compute each student's GPA. # Print, one per line: # Student ID, Total Points, GPA. # # Use this grading scale: # Score: 94 90 87 84 80 77 74 70 67 64 60
import sys
def main(): if len(sys.argv) != 2: print("Usage:") print(" python q5-grades.py
# 1. Read the file. # 2. For each line, # 3. get the student, and score # 4. convert score to grade points # 5. update student's total points # 6. For each student, # 7. get total points, and average points.
if __name__ == '__main__': main()
part of scores.csv:
CS414 | dk2004 | 75 |
CS414 | ih2094 | 68 |
CS414 | mc2010 | 66 |
CS414 | yq2053 | 78 |
CS414 | le2069 | 68 |
CS414 | qy2068 | 78 |
CS414 | uh2074 | 96 |
CS417 | uh2074 | 76 |
CS417 | sx2001 | 80 |
CS417 | mc2010 | 85 |
CS417 | dk2004 | 82 |
CS417 | le2069 | 73 |
CS417 | rk2055 | 89 |
CS417 | pq2037 | 70 |
CS415 | le2069 | 78 |
CS415 | uh2074 | 66 |
CS415 | ih2094 | 79 |
CS415 | yq2053 | 72 |
CS415 | qy2068 | 83 |
CS415 | sx2001 | 82 |
CS415 | rk2055 | 89 |
CS415 | pq2037 | 82 |
CS415 | mc2010 | 80 |
CS415 | dk2004 | 89 |
CS416 | dk2004 | 75 |
CS416 | sx2001 | 71 |
CS416 | uh2074 | 76 |
CS416 | qy2068 | 83 |
CS416 | ih2094 | 63 |
CS416 | le2069 | 72 |
CS416 | mc2010 | 84 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started