Create a class call Card.java, it shouldcontain at least 2 variables one is suit(“Spade” , ”Heart”,“Diamond”, “Club”) and the other one is rank(1~13). Please new 26card instances using the followings:
// You should know how to use thefollowing code to achieve what you want.
import java.util.*;
Card cards[] = new Card[26];
String suit[] = {“Spade” , ”Heart”,“Diamond”, “Club”};
Random r = new Random[52];
for(int i = 0; i < cards.length;i++){
cards[i] = newCard(r.nextInt(13)+1, suit[r.nextInt(100)%4]);
//You should design theabove constructor inside the Card.java
}
After this, pleasesort the array cards. To compare two cards, first of all you haveto
PayPal Gateway not configured
PayPal Gateway not configured