Difference between revisions of "IB CS1 3rd Quarter Exam"
From WLCS
(New page: === Directions: === * This exam is open-book, open-notes, closed-person. * You are an avid Dungeons and Dragons player, but you have so many characters, you have a difficult time keeping ...) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | === Directions | + | <!-- |
+ | === Directions === | ||
* This exam is open-book, open-notes, closed-person. | * This exam is open-book, open-notes, closed-person. | ||
* You are an avid Dungeons and Dragons player, but you have so many characters, you have a difficult time keeping track of them all! You must implement the following class and program for your D&D Character Database | * You are an avid Dungeons and Dragons player, but you have so many characters, you have a difficult time keeping track of them all! You must implement the following class and program for your D&D Character Database | ||
− | === Character class | + | === Character class === |
'''Attributes:''' | '''Attributes:''' | ||
* player name (string) | * player name (string) | ||
Line 26: | Line 27: | ||
=== Program === | === Program === | ||
# Create an empty list named myCharacters | # Create an empty list named myCharacters | ||
− | # | + | # Using a loop, display a menu that lets the user (a)dd, (r)emove, (s)earch, a(t)tack, (d)efend, (p)rint, (q)uit |
#* The (a)dd option should prompt the user for all the necessary attributes of a Character and then append one to the myCharacters list | #* The (a)dd option should prompt the user for all the necessary attributes of a Character and then append one to the myCharacters list | ||
#* The (r)emove option should prompt the user for a name and remove the character | #* The (r)emove option should prompt the user for a name and remove the character | ||
Line 32: | Line 33: | ||
#* The a(t)tack option prompts the user for a character name and then runs its attack() method/function | #* The a(t)tack option prompts the user for a character name and then runs its attack() method/function | ||
#* The (d)efend option prompts the user for a character name and then runs its defend() method/function | #* The (d)efend option prompts the user for a character name and then runs its defend() method/function | ||
+ | #* The (p)rint option prints out ALL of the user's characters | ||
+ | #* The (q)uit option breaks out of the menu's loop | ||
+ | |||
+ | === Grading Rubric === | ||
+ | * 3 pts - Character class correctly contains all necessary attributes | ||
+ | * 2 pts - __init__() method | ||
+ | * 2 pts - __str__() method | ||
+ | * 2 pts - attack() method | ||
+ | * 2 pts - defend() method | ||
+ | * 12 pts - Program (2 pts per option) | ||
+ | --> |