Question: This exercise is a variation of the 24-point card game described in Programming Exercise 20.13. Write a program to check whether there is a 24-point

This exercise is a variation of the 24-point card game described in Programming Exercise 20.13. Write a program to check whether there is a 24-point solution for the four specified numbers. The program lets the user enter four values, each between 1 and 13, as shown in Figure 20.21. The user can then click the Solve button to display the solution or display ?No solution? if none exist.

HExercise20_17 H Exercise20_17 (3+8-5)*4 l0|X| CHExercise20_17 Solve No solution 8+(5-1)*4 Solve Solve

The 24-point game is to pick any 4 cards from 52 cards, as shown in Figure

5 8 10 4 3 4 5. Exercise20_13 ]X| | Exercise20_13 -

King, Queen, and Jack represent 1, 13, 12, and 11, respectively. You can click the Shufflebutton to get four new cards. Enter an expression that uses the four numbers from the four selected cards. Each number must be used once and only once. You can use the operators (addition, subtraction, multiplication, and division) and parentheses in the expression. The expression must evaluate to 24. After entering the expression, click the Verifybutton to check whether the numbers in the expression are currently selected and whether the result of the expression is correct. Display the verification in a label before the Shufflebutton. Assume that images are stored in files named 1.png, 2.png, . . . , 52.png, in the order of spades, hearts, diamonds, and clubs. So, the first 13 images are for spades 1, 2, 3, . . . , and 13.

HExercise20_17 H Exercise20_17 (3+8-5)*4 l0|X| CHExercise20_17 Solve No solution 8+(5-1)*4 Solve Solve 5 8 10 4 3 4 5. Exercise20_13 ]X| | Exercise20_13 - Jo|| The numbers in the expression don't match the numbers in the set Shuffle Correct Shuffle Enter an expression: 3 + 4 + 5 + 5 venty Enter an expression: (11/ 11 + 2) * 8 Verify Exercise20 13 - l0|x| Incorrect result Shuffle Enter an expression: (11/ 11 + 2) + 8 Venfy

Step by Step Solution

3.44 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Program Plan Create a class CardGame24PointCal which extends Application class Create static class PointCardGamePane which extends GridPane PointCardGamePaneint size int gamePointVar is a parameterize... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!