Write a Python program

111 views 6:50 am 0 Comments August 2, 2023

Mr. Garvey is the substitute teacher for today’s class. He has twenty years experience teaching in inner city schools. He broke his clipboard in an earlier class and needs your help taking attendance and verifying club membership before students are dismissed early for yearbook photos. Student Jacqueline Blake Denise Aaron Timothy Jessica Cheryl Geoffrey Attendance unk unk a unk p p unk unk Club Future Leaders of America Spanish Chess Glee unk Band unk Stars Write a Python program using lists to store the students’ names, their current attendance status, and their current club. This data is provided for you in the table above. Your program should prompt the user to enter a student’s name. Your program should allow for upper case or lower case entries. If the student’s name is on the class roll, the student’s attendance status will be displayed. If the student’s name is not on the class roll, display a regret message with the student’s name like the example provided in the Expected Output below. If the attendance status is unknown, ask the user to enter a p for present or an a for absent. Your program should allow upper case or lower case entries. Record attendance in lower case. Display a statement indicating the attendance was saved, like the example provided in the Expected Output below; be sure your code shows you printed from the list after the update, not from the input. Next, the program will display the club name the student joined. If the club name is unknown, display the club names, skipping over the unknowns, and ask the user to enter a club name. The available club names are listed below. Your program should allow upper case or lower case entries. Save the club name in Title Case. Display a statement indicating the club name was saved, like the example provided in the Expected Output below; be sure your code shows you printed from the list after the update, not from the input. EXPECTED OUTPUT from four separate runs of your program (red indicates user input) (the dashed line should not be in your output, it is a separator I added between runs): Please enter a student’s name: JACQUELINE Jacqueline’s attendance status is unknown. Please enter ‘a’ for absent or ‘p’ for present: p Thank you, the new attendance code is saved as: p Jacqueline is a member of the Future Leaders of America club. ————————————————————————————– Please enter a student’s name: timothy Timothy’s attendance status is present. Timothy’s club membership is unknown. Valid club names are: Future Leaders of America Spanish Chess Glee Band Stars Please enter a club name for this student: glee Thank you, the new club membership is saved as: Glee ———————————————————————————– Please enter a student’s name: cheryl Cheryl’s attendance status is unknown. Please enter ‘a’ for absent or ‘p’ for present: p Thank you, the new attendance code is saved as: p Cheryl’s club membership is unknown. Valid club names are: Future Leaders of America Spanish Chess Glee Band Stars Please enter a club name for this student: STARS Thank you, the new club membership is saved as: Stars ————————————————————————————- Please enter a student’s name: Pamela Sorry, Pamela is not in this class. ————————————————————————————-

Tags: , , , , , , , , , ,