#!/usr/bin/env python """ Georgia Institute of Technology - CS1301 Introduction to Object Oriented Programming using Python. """ __author__ = "YOUR NAME HERE" """ COLLABORATION STATEMENT HERE """ class Student(object): """ docstring of a Student object. Student have the following properties: Attributes: name: A string representing the student's name. gtid: A string representing the student's GT id. year: An integer representing the student's class (default: 1) 1 -> Freshman 2 -> Sophomore 3 -> Junior 4 -> Senior courses: A dictionary representing the courses a student is enrolled. Key -> A string representing a Course code Value -> [A Course object, grade (an integer 0-4)] """ def __init__(self, name, gtid, year = 1): """Initialize a Student object whose name is *name*, gtid is *gtid*, gpa is *gpa*, class standing is *year*; courses start empty""" #TODO write your own implementation here pass def calculate_gpa(self): """ Returns a float of the student's gpa. To calculate GPA: 1. If student has no courses his gpa must be 0.0 2. Multiply the grade (0-4) by the number of credit to get quality poins. 3. Total the credit hours. Total the total quality points. 4. Divide the total quality points by the total credit hours""" #TODO write your own implementation here pass def set_year(self, year): """ change student's year. year is now *year* """ #TODO write your own implementation here pass def in_dean_list(self): """ return true if gpa greater than or equal 3, false otherwise """ #TODO write your own implementation here pass def get_real_year(self): """ return a string representation of the student's class standing 1 -> Freshman, 2 -> Sophomore, 3 -> Junior, 4 -> Senior """ #TODO write your own implementation here pass def get_total_credits(self): """ return the amount of credits a student is taking as an int""" #TODO write your own implementation here pass def register(self, course): """ Add a course to the student's courses. No duplicate courses are allowed. If student is registered for X course with X professor, it should not be allowed to registered for X course with Y professor. The initial grade for the course should be 0.""" #TODO write your own implementation here pass def register_many(self, courses): """ register courses from a list of Course objects """ #TODO write your own implementation here pass def drop(self, course): """ Drop a course if student is registered to it. Return True if successfully dropped and False if student is not registered for that course. """ #TODO write your own implementation here pass def is_taking(self, course): """ Returns true if student is registered for a course """ #TODO write your own implementation here pass def __str__(self): """ String representation of a Student object """ return "({0}, {1}, {2})".format(self.name, self.get_real_year(), self.calculate_gpa()) class Course(object): """ docstring of a Course object. Course have the following properties: Attributes: code: A string representing the course code (i.e CS1301) credits: An integer representing the course's amount of credits (i.e 3) instructor: An Instructor object representing the instructor of the course """ def __init__(self, code, credits, instructor): """Initialize a Course object whose code is *code*, credits is *cresits*, and instructor is *instructor*.""" #TODO write your own implementation here pass def get_code(self): """ returns string representing the course code """ #TODO write your own implementation here pass def get_credits(self): """ returns int representing the course credits """ #TODO write your own implementation here pass def __str__(self): """ String representation of a Course object """ return "({0}, {1}, {2})".format(self.code, self.credits, self.instructor) def __repr__(self): return "".format(self.code, self.credits, self.instructor) class Instructor(object): """docstring of an Instructor object. Instructor have the following properties: Attributes: name: A string representing the instructor name (i.e CS1301)""" def __init__(self, name): """Initialize an Instructor object whose name is *name*.""" #TODO write your own implementation here pass def assign_grade(self, student, course, grade): """ If student is taking a course, change the student's grade in a course by *grade*. grade is a number between 0 and 4 inclusively. The max a student can get in a course is 4.""" #TODO write your own implementation here pass def __str__(self): """ String representation of an Instructor object """ return "{0}".format(self.name) def __repr__(self): return "".format(self.name) if __name__ == '__main__': pass