ME 4990: Intro to CS�Object-Oriented Programming & Machine Learning 101
�
Static Methods and OOP Review
Outline
Introduction
Introduction
Static Method, see static_eg
Class Attribute
Instance Attribute
Class Attribute Declaration
Use Class Attribute
Outline
Card
We can define card class
Class methods
Deck class
cards
[52*Card]
list
Deck
deck1�Instance
Deck class operation
Hand class
Hand class
Cards
label
[]
list
Hand
hand1�Instance
UML
Exercise 1
Write a Deck method called deal_hands that takes two parameters, the number of hands and the number of cards per hand. It should create the appropriate number of Hand objects, deal the appropriate number of cards per hand, and return a list of Hands.
Terms
Exercise 2
Exercise 3
Exercise 4
http://en.wikipedia.org/wiki/Hand_rankings