Professional Documents
Culture Documents
Design a Student class so that the following output is produced upon executing the
following code
s1 = Student(“Alice”,“20103012”,“CSE”) ##########################
s2 = Student(“Bob”, “18301254”,“EEE”) Name: Alice
s3 = Student(“Carol”, “17101238”,“CSE”) ID: 20103012
print(“##########################”) Department: CSE
print(s1.details()) ##########################
print(“##########################”) Name: Bob
print(s2.details()) ID: 18301254
print(“##########################”) Department: EEE
s1.advise(“CSE110”, “MAT110”, “PHY111”) ##########################
print(“##########################”) Alice, you have taken 9.0 credits.
s2.advise(“BUS101”, “MAT120”) List of courses: CSE110, MAT110, PHY111
print(“##########################”) Status: Ok
s3.advise(“MAT110”, “PHY111”, “ENG102”, ##########################
“CSE111”, “CSE230”) Bob, you have taken 6.0 credits.
List of courses: BUS101, MAT120
Status: You have to take at least 1 more
course.
##########################
Carol, you have taken 15.0 credits.
List of courses: MAT110, PHY111, ENG102,
CSE111, CSE230
Status: You have to drop at least 1 course.
Question 3
Write the Hotel class with the required methods to give the following outputs as shown.
Write the Author class with the required methods to give the following outputs as
shown.