Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Ruby program that includes two classes Deck and Card. See attached document. Store your program in a file called myDeck.rb (40 points) Sample

image text in transcribed

Write a Ruby program that includes two classes Deck and Card. See attached document. Store your program in a file called myDeck.rb (40 points) Sample Input/Output ruby.exe mydeck.rb 15 o Ac, 5s, 7d, Qc, 7h, 8c, Jh, 9d, Qs, 5c, Ts, Jd, 7s, 3d, 6c o Error: Argument number must be a positive number o Output all cards ruby.exe mydeck.rb -1 ruby.exe mydeck.rb 60 Must use the below outline. Thank you in advance! # Class Card represents a playing card class Card # Assign a new card a rank and a suit def initialize(rankVal, suit) End # Returns a readable string representation of a card (see sample output) def tostring end end # Class Deck represents a deck of 52 playing cards. Rank 2 through Ace; Suits # spades (s), hearts (h), diamonds (d), clubs (c) class Deck

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago