This week you learned the basic principles of object-oriented programming, and how classes model …

This week you learned the basic principles of object-oriented programming, and how classes model real-world objects.

Now you can use this knowledge to simulate playing-cards.

– Implement a class called Card to represent a playing card. The class should have the following methods:

__init__(self, rank, suit)  – to create a new card. rank is an int in the range 1-13 indicating the ranks from Ace (1) to King (13). suit is a single character – ‘d’, ‘c’, ‘h’, or ‘s’ indicating the suit (diamonds, clubs, hearts, or spades)

getRank(self) – returns the card’s rank

getSuit(self) – returns the card’s suit

BJValue(self) – returns the card’s Blackjack value (Ace = 1, face cards = 10)

__str__(self) – returns the card’s full name (e.g. “Ace of Spades”)

– Save your class in a file called card.py

– Other programs should be able to import your class and create a card like this:

from card import Card c = Card(1,”s”) print(c.getRank()) # should print 1 print(c.getSuit()) # should print ‘s’ or ‘Spades’ print(c.getBJValue()) # should print 10 for face cards & rank for others print(c) # should print ‘Ace of Spades’

Hint

Your __str__ method will need some way to match card rank and suit values with longer form values. Consider whether a lists or a dictionary is better for each.

Extra Credit

Write a function in card.py, but not part of the Card class, that asks the user whether to draw a card. If the user agrees, the function should create a new card with randomly selected value and suit. The program should display the combined total of Blackjack values after each draw, and prompt the user to draw another card until the total exceeds 21.

 

“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”

The post This week you learned the basic principles of object-oriented programming, and how classes model … appeared first on Nursing Assignment.

 

“Are you looking for this answer? We can Help click Order Now”

The post This week you learned the basic principles of object-oriented programming, and how classes model … first appeared on Nursing Essays Writers.


Learning: Classroom of Life

To prepare for this discussion, please read Chapter 5 of your textbook. In addition, watch Classical and Operant Conditioning. Finally, review Instructor Guidance and Announcements. In this discussion, you will consider learning from a psychological perspective by explaining operant conditioning and applying it to a real-life scenario. Be sure to use your own academic voice (Links to an external site.)Links to an external site. and apply in-text citations (Links to an external site.)Links to an external site. appropriately throughout your post. ThinkstockPhotos-159290591.jpg ThinkstockPhotos-483897106.jpg •Watch Classical and Operant Conditioning, which distinguishes between classical and operant conditioning by describing many important concepts.   •Discuss learning. In your discussion, include the following: ◦Describe operant conditioning. ◦Select one of the following situations from everyday life in which learning (i.e. a relatively permanent change in behavior) is desirable. ◾Margot wants her husband, Todd, to stop leaving his dirty laundry on the floor. ◾Coach K wants to increase his basketball players’ free throw percentages. ◾Mr. Moore wants his dog to stop jumping up on visitors. ◾Biggs Boss wants his employees to arrive on time. ◾Mrs. O’Neill wants her preschoolers to raise their hands before speaking. ◾Joe wants his son to earn good grades. ◾Jack wants his girlfriend, Jill, to show more affection. ◾Marty wants his friend, Dave, to stop smoking. ◾ Insert your own situation: ____________________________________ •Prepare a behavior modification plan in which you effectively utilize operant conditioning principles to change the behavior of the targeted individual(s). ◦Clearly identify and describe suitable reinforcers or punishers to attain your desired outcome. ◦Example: If I want my son to eat his vegetables (i.e., increase a desired behavior), I could do several things. ◾If he eats his vegetables, I could apply a positive reinforcer by adding something he does like, such as screen time; alternatively, I could apply a negative reinforcer by taking away something he does not like, such as one of his weekly chores. ◾If he does not eat his vegetables, I could apply a positive punisher by adding something he does not like, such as a new weekly chore; alternatively, I could apply a negative punisher by taking away something he does like, such as screen time. ◦Defend your use of reinforcement and/or punishment as applied to the scenario. Why did you choose it? Why do you expect it to work? ◦Apply your knowledge of ethical considerations as relevant to operant conditioning. •Remember to use your own academic voice (Links to an external site.)Links to an external site. and apply in-text citations (Links to an external site.)Links to an external site. appropriately throughout your post. Post your initial response of 250 words

 

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post Learning: Classroom of Life appeared first on Top Premier Essays.

 

“Are you looking for this answer? We can Help click Order Now”

The post Learning: Classroom of Life first appeared on Nursing Essays Writers.


Using MLA style, write 3 -4 page essay response. Use the texts as support. Have a solid, defendable

Using MLA style, write 3 -4 page essay response. Use the texts as support. Have a solid, defendable thesis statement. Do not use outside sources and bring up relevant points. Prompt: Dracula and The Metamorphosis explore horrifying fantasy but in very different styles. How do the different styles of the works affect your reading of the stories? What are the authors' purposes in using these styles?

 

“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”

The post Using MLA style, write 3 -4 page essay response. Use the texts as support. Have a solid, defendable appeared first on Nursing Assignment.

 

“Are you looking for this answer? We can Help click Order Now”

The post Using MLA style, write 3 -4 page essay response. Use the texts as support. Have a solid, defendable first appeared on Nursing Essays Writers.


discussions-214

I need 3 paragraphs one for my project and the other 2 responds to 2 of my classmates. I will attach my project so u can have a look at it. Complete the third milestone project– a post and two peer replies to the 4-2 Discussion board. This board requires you to find and post…
The post discussions-214 first appeared on | Nursing Homework Help Service.

 

“Are you looking for this answer? We can Help click Order Now”

The post discussions-214 first appeared on Nursing Essays Writers.