PYTHONDesign the “Student_Database” class so that the given output isproduced for the given code. Your code should work for any numberof arguments passed to the “addStudents” method.
[Hint: A student ID should always be 8 digits long. In astudent ID, the first 2 digits represent the admission year and the3rd digit represents the admission semester where 1 denotes“Spring”, 2 denotes “Fall” and 3 denotes“Summer”.]
# Write your code here
# Do not change the following lines ofcode.
database = Student_Database("2022", 3)
print("1.=================================")
database.addStudents("22101401", "22201501","22211402")
print("2.=================================")
database.addStudents("22301403","22302502")
print("3.=================================")
database.printDetail()
print("4.=================================")
database.printDetail("Fall")
print("5.=================================")
database.addStudents("21301815")
print("6.=================================")
database.addStudents("223018156")
print("7.=================================")
database.printDetail()
2ND CODE
Design the Building class so that the given output isproduced for the given code. Your code should work for any numberof arguments passed to the “addRooms” method.
[Hint: Room number format: UBXYYZZ ; where X representsbuilding number, YY represents floor number , ZZ represents roomnumber.]
# Write your code here
# Do not change the following lines ofcode.
UB7 = Building("Building No-7", 9)
print("1.=================================")
UB7.addRooms("UB70401", "UB70501","UB70402")
print("2.=================================")
UB7.addRooms("UB70403", "UB70502")
print("3.=================================")
UB7.printDetail()
print("4.=================================")
UB7.printDetail("5")
print("5.=================================")
UB7.addRooms("UB80815")
print("6.=================================")
UB7.addRooms("UB71003")
print("7.=================================")
UB7.printDetail()
PYTHON Design the “Student_Database” class so that the given output is produced for the given code. Your code should wor
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am