Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA: 20.5 Program 2a: Playing Cards Objectives 1. Practice with classes and objects 2. Code a class of playing cards Background Reading and Resources .

JAVA:

image text in transcribed

20.5 Program 2a: Playing Cards Objectives 1. Practice with classes and objects 2. Code a class of playing cards Background Reading and Resources . ZyBooks Chapter 7 Objects and Classes Make sure you have an IDE that you can use Program to turn in We are going to stick with this playing cards theme and this time just focus on the characteristics and functionality of just the cards themselves. In this program you will be creating a PlayingCardjava file in your IDEs that will have the following characteristics Class Variables public String rank; public String suit; Class Methods: class PlayingCard -public String getIdentificationString ) -public PlayingCard (String rank, String suit) -public String goodCard (String rank) -public String getRank () -public String getsuit) -public String tostring () public String getldentificationString0,this will be found in almost all of your programs for the year this just returns a string with the program number and letter, your first and last name, and your cssc number. For example Program 2a, Firstname Lastname public playingCard(String rank, String suit), this will be your constructor for your class. Be sure to use "this. to set the rank and suit of the constructor to the class variables rank and suit. public String goodCard(String rank), I am looking for some good cards when I draw them and this method is going to help me out. If a card is a 10", Jack, "Queen", "King, or Ace" have this method return a string that says: That's a good card! If it is not one of those cards have it say This card is alright. public String getRank0, return the rank of my card public String getSuit0. return the suit of my card public String toString).have this method return a string with the rank and the suit of the card in the format of how you would say it's name So for example: 2 of Hearts or Ace of Spades

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

Step: 3

blur-text-image

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago