I need an experienced JAVA programmer to help me with the fo
I need an experienced JAVA programmer to help me with the following assignment. The task is to create a program to simulate the card game \"24\" and will find all the 4-card combinations that solve the problem and print out one solution for each of the combinations. This program requires test cases and code commentary in order to help with my understanding. Further information and requirements provided below. Thank you.
Card Game: 24 In this game, 4 cards are randomly picked from 52 cards, and we need to use these 4 cards and addition, subtraction, multiplication, division and parentheses to make a 24. Note each of the 4 card can only be used once. The below lists the face value of each card. “2” : 2 \"3\" 3 “4\" : 4 \"5\" 5 \"6\" 6 7\":7 \"8\" 8 \"9\" 9 \"10\" 10 \"Q\" 12 \"K\" 13 For example, if the 4 cards are \"A 2 3 Q\", then we can do (3-2 + 1) * 12 = 24. Read the following link for more information about the game. https:/len.wikipedia.org/wiki/24 Game Our job for this assignment to . n all t e alutions are . find all the 4-card combinations that the solutions are available, . and print out one solution for each of these 4-card combinationsSolution
import java.util.Random; 02 public class DemoCardsAgain { 03 public static void main(String[] args) { 04 Random myRandomizer = new Random(); 05 //52 cards in a deck. 06 07 //this demo will print a loop based off of array index is selected then putting a string value 08 //to that random index will be printed in loop statement. Try to sum cards now 09 10 String[] ranks = {\"Ace\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\",\"10\", \"Jack\", \"Queen\", \"King\"}; 11 12 String myCard; 13 int sumOfCards= 0; 14 for (int i =0; i< 13; i++) { 15 int cardRan = myRandomizer.nextInt(ranks.length); 16 17 if (cardRan ==0) { 18 myCard = \"Ace\"; 19 sumOfCards= 1; 20 System.out.print(myCard); 21 } 22 23 if (cardRan ==1) { 24 myCard = \"2\"; 25 sumOfCards = 2; 26 System.out.print(myCard); 27 } 28 29 if (cardRan ==2) { 30 myCard = \"3\"; 31 sumOfCards= 3; 32 System.out.print(myCard); 33 } 34 if (cardRan ==3) { 35 myCard = \"4\"; 36 sumOfCards= 4; 37 System.out.print(myCard); 38 } 39 if (cardRan ==4) { 40 myCard = \"5\"; 41 sumOfCards= 5; 42 System.out.print(myCard); 43 } 44 if (cardRan ==5) { 45 myCard = \"6\"; 46 sumOfCards= 6; 47 System.out.print(myCard); 48 } 49 if (cardRan ==6) { 50 myCard = \"7\"; 51 sumOfCards= 7; 52 System.out.print(myCard); 53 } 54 if (cardRan ==7) { 55 myCard = \"8\"; 56 sumOfCards= 8; 57 System.out.print(myCard); 58 } 59 if (cardRan ==8) { 60 myCard = \"9\"; 61 sumOfCards= 9; 62 System.out.print(myCard); 63 } 64 if (cardRan ==9) { 65 myCard = \"10\"; 66 sumOfCards= 10; 67 System.out.print(myCard); 68 } 69 if (cardRan ==10) { 70 myCard = \"Jack\"; 71 sumOfCards= 11; 72 System.out.print(myCard); 73 } 74 if (cardRan ==11) { 75 myCard = \"Queen\"; 76 sumOfCards= 12; 77 System.out.print(myCard); 78 } 79 if (cardRan ==12) { 80 myCard =\"King\"; 81 sumOfCards=13; 82 System.out.print(myCard); 83 } 84 System.out.println(); 85 } 86 if (sumOfCards + sumOfCards + sumOfCards + sumOfCards == 24) { 87 System.out.println(\"Sum of four cards is \" + (sumOfCards + sumOfCards + sumOfCards + sumOfCards)); //close...but something is wrong 88 } 89 }