# Can a student use a class with methods that include parameters on Create Performance Task?

**URL:** <https://forum.code.org/t/can-a-student-use-a-class-with-methods-that-include-parameters-on-create-performance-task/39301>\
**Category:** AP Prep\
**Created:** [April 13, 2024, 10:33pm UTC](https://forum.code.org/t/can-a-student-use-a-class-with-methods-that-include-parameters-on-create-performance-task/39301 "2024-04-13T22:33:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctremain](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@ctremain](https://forum.code.org/u/ctremain)\
**Post date:** [April 13, 2024, 10:33pm UTC](https://forum.code.org/t/can-a-student-use-a-class-with-methods-that-include-parameters-on-create-performance-task/39301/1 "2024-04-13T22:33:05Z")

</div>

My first-year teaching AP CS. Below is the code the student is using. The project is blackjack.

# creates a card object that has three characteristics- it’s name, it’s suit, and it’s point value in the game. it also creates methods that allow the access of the characteristics of the card so it can be used in the game

class Card:  
def **init** (self, s, n, v):  
self.name = n  
self.suit = s  
self.val = v

```
def return_name(self):
    return self.name

def return_suit(self):
    return self.suit

def return_val(self):
    return self.val

def __str__ (self):
    return self.name + self.suit

```

# makes a deck of 52 cards, 13 cards 2-A, for each suit, and assigns each card to a random spot in the deck arraylist to make sure the cards are shuffled

def make\_deck():  
global deck  
suit = “”  
deck =   
spot = 0  
for i in range(3, 7):  
if i == 3:  
suit = “hearts”  
if i == 4:  
suit = “diamonds”  
if i == 5:  
suit = “clubs”  
if i == 6:  
suit = “spades”  
for num in range(1, 14):  
if num == 1:  
deck.append(Card(str(suit), “Ace”, 11))  
elif num == 11:  
deck.append(Card(str(suit), “Jack”, 10))  
elif num == 12:  
deck.append(Card(str(suit), “Queen”, 10))  
elif num == 13:  
deck.append(Card(str(suit), “King”, 10))  
else:  
deck.append(Card(str(suit), str(num), num))  
spot += 1

---

<div class="post-metadata">

**Author:** ![bhatnagars](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/bhatnagars/32/4919_2.png) [@bhatnagars](https://forum.code.org/u/bhatnagars)\
**Post date:** [April 25, 2024, 4:55pm UTC](https://forum.code.org/t/can-a-student-use-a-class-with-methods-that-include-parameters-on-create-performance-task/39301/2 "2024-04-25T16:55:23Z")

</div>

I would look at the rubric provided on page 189 of the [course and exam description](https://apcentral.collegeboard.org/media/pdf/ap-computer-science-principles-course-and-exam-description.pdf) to decide.
