Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started