Object Oriented Programming Basics

ACTIVITY 1
Create a class named Pokemon that has the following instance variables: number, name, and combat_points. Add a constructor method that enables a new Pokémon to be created. Add methods named get_name, get_number, get_combat_pointsand set_combat_points. Then, write a program that utilizes the functionality of the Pokemon class in its entirety.

ACTIVITY 2
In the game of Black Jack, an ace is worth 11 points, a king is worth 10 points, a queen is worth 10 points, a jack is worth 10 points, and all other cards are worth face value. Download card.py and blackjack.py onto your local machine. Complete method assign_value and function process_handsuch that the following output is produced when the program is run.

<code>ace of spades, king of diamonds evaluates to 21

queen of hearts, ace of spades evaluates to 21

ace of spades, jack of clubs evaluates to 21

ten of spades, ace of spades evaluates to 21

two of spades, three of clubs, four of diamonds, five of hearts, six of spades, seven of clubs evaluates to 27

eight of diamonds, nine of hearts, two of spades evaluates to 19
</code>
ACTIVITY 3
Download carddeck.py.

Answer the following questions:
What is cards in the program?
What does the Deck constructor do?
Uncomment the two commented statements at the bottom and supply the missing shufflemethod.
Split the solution into three files: Card.py, Deck.py and carddeck.py.

Sample Solution

ngagement by everyone. it absolutely was a difficulty of respect and support to win and to style laborious on a regular base.

•​Nobody took a free ride and if there was an indication toward on these lines the event had created approaches to manage settle it.

Amidst my lord business I worked in numerous social events beginning at as recently. To the degree I will tell I did not expertise social idling impacts once there was an excited, not too straightforward to satisfy objective for the get-together and a setting of accomplices with high game-plan and skill to accomplish that objective.

There’s faithfully a partner that does not pull their weight. In cash connected problems this is often referred to as a free rider issue—individuals who advantage from assets they do not obtain. author professional and creator of Originals Adam Grant (building up an recent Meta examination by Karau and Williams) saw a development of segments that urge people to contribute what is returning to them.

•​Make the trip additional imperative. people sporadically die away once they do not feel that the endeavor matters. once they see the cruciality of their endeavors, t

This question has been answered.

Get Answer
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
👋 Hi, Welcome to Compliant Papers.