For this program we need the lower value for the winning card or player: we hava
ID: 642272 • Letter: F
Question
For this program we need the lower value for the winning card or player:
we hava peace card method which is the derivate class of card. the new class will override the winner () class but will reuse others method from card
second we have peacedeck same as above but with deck and new class will use a constructor that initialize the superclass array of card and same will reuse all method or function in deck.
This is was I got so far:
Explanation / Answer
public class PeaceCard extends Card{ @Override public boolean winner(Card b){ boolean re=true; if(this.cardValue > b.cardValue) re=false; else if((this.cardValue == b.cardValue)&&(this.suitValue > b.suitValue)) re=false; return re; } } public class PeaceDeck extends Deck { public PeaceDeck() { for(int i=1;iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.