Page 1 of 1

how do you answer these in python

Posted: Sat May 14, 2022 7:43 pm
by answerhappygod
how do you answer these in python
How Do You Answer These In Python 1
How Do You Answer These In Python 1 (69.8 KiB) Viewed 29 times
How Do You Answer These In Python 2
How Do You Answer These In Python 2 (111.72 KiB) Viewed 29 times
Extra Credit, Part 1 (You can do either or both parts of the extra credit.) Write a remove method that removes a student from a course and add it to both the Student and Course classes. If the student isn't in the course, it should do nothing (it should not generate an error). Try removing Vinod Khosla from CS 0101 and print out the cs0101 and Vinod objects again to show that he was removed. Then try removing him a second time. This should do nothing but should not generate an error even though he is no longer in the class. Given the example objects above in the sample main program above, how do you access Joe Wang's office using the variable that points to the class that he teaches? Print out the office by accessing it in this manner.

Extra Credit, Part 2 Write out five CSV files using the sample data given above, one each for the professors, students, courses, professor-course relationships, and student-course relationships. You need to get the data out of the objects created after running the main program above; you can do things like put the object variable names in lists or dictionaries. You are not allowed to write out the literal values with statements like f.write("Janine Tanaka, jt8764,WWH 419\n") etc. The professor CSV should have each professor's name, uni, and office in each row. As there are two professors, there should be two rows. The student CSV should have each student's name, uni and year in school in each row. As there are three students, there should be three rows The course CSV should have each course's number, meeting time, and location in each row. As there are two courses, there should be two rows. The professor-course CSV should have, for each professor-course pair, professor's uni and the course name in each row. There are two such relationships, so there should be two rows. The student-course CSV should have, for each student-course pair, the student's uni and the course name in each row. There are four such relationships, so there should be four rows.