Question: IN JAVA. uestion 2 (2-dimensional Arrays Write a program that implements a card magic game where you accurately predict a user's card from a randomly

IN JAVA.

IN JAVA. uestion 2 (2-dimensional Arrays Write a program that implements acard magic game where you accurately predict a user's card from a

uestion 2 (2-dimensional Arrays Write a program that implements a card magic game where you accurately predict a user's card from a randomly generated 4x4 card matrix. Your program should proceed as follows 1. Generate a random 4x4 card matrix and print it on the screen. Tips: You could use a 1D index array for card numbers, 4x4 matrix for cards with one row each for 4 card types. You can randomize rows and columns independently using a loop to swap values at random or use the randomizeArray() method 2. Ask a user to pick a card and to enter the corresponding column number for that card. (You have to make sure that the user enters a number between 1 and 4 and nothing else.) 3. Transpose the 4x4 card matrix (i.e. rows matrix becomes column matrix) and print it on the screen. Ask user for the new column number for his chosen card. (Simply swap loop variables.) a b c d ef Original g h i matrix a b c d e f g h i a d g b e h 4. Make use of the two inputs from the user to predict his card. Your program output should be displayed in the format below. The user should be able to request for another try until he is satisfied that program correctly predicts the card every single time 5. When a user chooses to stop, your program should display a closing message like 'Thank you for using the JAVA Magic 101 Program.' Here is an example of the output to illustrate the expected behavior of your program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!