Question: Rewrite Exercise 20.13 using JSF, as shown in Figure 33.34. Upon clicking the Refresh button, the program displays four random cards and displays an expression
Rewrite Exercise 20.13 using JSF, as shown in Figure 33.34. Upon clicking the Refresh button, the program displays four random cards and displays an expression if a 24-point solution exists. Otherwise, it displays No solution.
The 24-point game is to pick any 4 cards from 52 cards, as shown in Figure. Note that the Jokers are excluded. Each card represents a number. An Ace, King, Queen, and Jack represent?1,?13,?12, and?11, respectively. You can click the?Shuffle?button 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?Verify?button 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?Shuffle?button. 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.


| Exercise 20_13 | Exercise20_13 The numbers in the expression don't match the numbers in the set Correct Shuffle Shuffle verify (11/ 11 + 2) * 8 Enter an expression: Enter an expression: 3+4 +5+5 venty -lo|| Exercise20 13 Incorrect result Shfle Enter an expression: (11/ 11 + 2) + 8 Verify O 24-Point Game - Mozilla Firefox Fle Edit vew HIstory Bookmarks Ioos Hep O 24-Point Game bcahost:8080/chapter33jsfexercke/faces/Exercke33_11.xhtml 8- Google 24-Point Game Refresh (11-10)*6*4 is 24 24-Point Game - Mozilkla Firefox Ele Edt vew History Bookmarks Ioos Hp | 24-Point Game bcahost:8080/chapter33Jsfexercke/faces/Exercke33_11.Xhtml| 8- Google 24-Point Game Refresh No solution a.
Step by Step Solution
3.52 Rating (162 Votes )
There are 3 Steps involved in it
Program Plan Create an xhtml file for the game view Create a class Exercise3311 which generates and evaluates the 24 point game expressions for different card combinations Create method findSolnint ca... View full answer
Get step-by-step solutions from verified subject matter experts
