Open main menu

CDOT Wiki β

Changes

OPS445 Online Lab6

232 bytes added, 11:22, 13 January 2022
m
Create a Python Script Demonstrating Classes
=== Create a Python Script Demonstrating Classes ===
<blockquote style="margin-left:35px;">{{Admon/note|style="padding-left:25px"|NOTE|If your professor is asking you to submit labs on GitHub, first follow their instructions on Blackboard to clone the lab6 repository.}}</blockquote>
 
:# The following python script is broken. It has two major problems to fix and one new feature to add: <br />'''first problem''' is providing the student number as an integer causes an error(TypeError) when displayStudent() is run, <br />'''second problem''' is in displayGPA() may divide by zero(ZeroDivisionError) if no courses are added to the dictionary or the grades added to the dictionary are 0.0 floats. <br />'''Finally''', you will add a new method to this class that prints out a formatted list of all courses the student has taken.
:#Create the '''~/ops445/lab6/lab6a.py''' script.
572
edits