The Game of Celebrity and Class Design Options

1. What classes might be used in creating a program to play Celebrity? 2. What instance variables might be needed in the Game class? 3. What behaviors might be needed for the Game class? 4. How would you describe the play method in the Game class using pseudocode? 5. Can you identify an object in your classroom with multiple parts and associated information and behaviors? 6. How can you improve your object based on feedback from a partner?

Class Design Options for the Game of Celebrity


1. Classes for the Game: When creating a program to play Celebrity, different classes can be used including the Game class, Player class, Round class, and Celebrity class. The Game class would keep track of overall game information, while the Player class would represent the participants, the Round class would manage each round of the game, and the Celebrity class would store information about the celebrities' names. 2. Instance Variables in the Game class: Some instance variables that might be needed in the Game class are the current round number, the teams participating, the scores of each team, and the container holding the folded papers with the names of celebrities. These variables would help in managing and tracking the progress of the game. 3. Behaviors for the Game class: The Game class would need behaviors such as playing a round, updating the scores of teams after each round, selecting a random paper from the container, and verifying if the guesser's answer is correct. These behaviors are essential for the functioning and logic of the game. 4. Description of the play method: ``` play method: Set currentRound to 1 Loop through each round: Play the round Update teams' scores End the game Declare the team with the highest correct guesses as the winner ``` 5. Real-World Object Example: An example of a real-world object in a classroom with multiple parts could be a microscope. The associated information could include details like the magnification level and the brand, while behaviors may involve adjusting the focus or changing the magnification level. 6. Improving the Object: Based on feedback from a partner, you could enhance the object by including information about the type of microscope, the materials it is made of, as well as additional behaviors like cleaning the lenses and calibrating the magnification level.

← Exciting insights into data science and machine learning Every full binary tree is also a complete binary tree →