W WolfCode · CSC 141

Homework: GPA Calculator

作业: GPA 计算器

≈ 40 min · python-decomposition python-functions · Open in WolfCode

Six functions — five helpers + one orchestrator. The shape of every analytics function you'll write at a job.

The six functions

  • grade_to_points(letter) — float lookup A=4.0 … F=0.0
  • course_quality_points(grade, c) — points × credits
  • total_quality_points(courses)
  • total_credits(courses)
  • gpa(courses) — guards 0.0 on empty
  • gpa_report(name, courses) — assembles dict
Python · runnable