Solution 1 Assignment 4 Due Sunday 16th of November 2014 Read the instructions below carefully The instructions must be followed java is provided for you
Solution Assignment Due Sunday th of November Read the instructions below carefully The instructions must be followed
Solution Assignment Due Sunday th of November Read the instructions below carefully The
th of November Read the instructions below carefully The instructions must be followed java is provided for you
Solution Assignment Due Sunday th of November Read the instructions below
carefully The instructions must be followed java is provided for you
Solution Assignment Due Sunday th of November Read
Solution Assignment Due Sunday
(Solution) 1 Assignment 4 Due Sunday, 16th of November, 2014 Read the instructions below carefully. The instructions must be followed.java is provided for you....

Category: General
Words: 1050
Amount: $12
Writer:

Paper instructions

Hi, how can i start off this question? Thanks.1 Assignment 4 Due Sunday, 16th of November, 2014 Read the instructions below carefully. The instructions must be followed. This assignment is worth 5 % of your grade. No late assignments will be accepted. For this assignment, you are allowed to use the concepts from the rst 7 chapters of the textbook. For this assignment a le called a4.java is provided for you. You should place all your code inside of this le in clearly indicated spaces and as detailed below. Place the le into a folder called A4 xxxxxx, where you should replace xxxxxx by your student number. Compress this folder into A4 xxxxxx.zip le. Submit your assignment, i.e., A4 xxxxxx.zip le, via Blackboard Learn. Submit your assignment via Blackboard Learn (as instructed in the rst lab.) Your code must compile, otherwise the assignment will be graded with mark 0. For that reason, if you run out of time and/or your program contains code that does not compile, then comment out that section of your code. For this assignment, you should program a version of a memory game (to be described below). If you do not know what it is, google it or see here, for example: http://www.brainmetrix.com/ memory-game/ Only your game will not use graphics libraries to display the board, but instead it will print the board with the tools that we have seen in class, like System.out.print() . Your game should use a 2D Java array (i.e., a matrix) as the board. The player should be asked if she wants to play the game on a 2x2, 4x4 or 6x6 board. The board should be lled with the rst size/2 capital letters of the English alphabet such that each letter appears exactly twice in the 2D array (Here size is 4 in case of 2x2 array, 16 in case of 4x4 array and 36 in case of 6x6 array). This part is already done for you inside of a4.java . Once such 2D array is created it needs to be shu ed before the game can be played (otherwise the game would be trivial as the locations of the letters would be predictable). To shu e a 2D array, rst copy it into an (1D) array. Then shu e that 1D array. To see how to do that, look at the last page of this assignment (or alternatively Listing 2: DeckOfCards.java in chapter 6.4 of your book). The last page contains a program that shu es a (1D) array of integers. Modify the part of the code labelled as Shu ing the array" for your needs. Once you are done shu ing your 1D array, copy it back into your 2D array (i.e., back to your board). This should be done inside of the shu eBoard method, as indicated in the a4.java le. Your program, i.e., a4.java, has a playGame method that should play the whole game. You will have to program this method. It takes as input the shu ed board. The game should be played as follows. When your program prints the board, the locations for which paring is not discovered yet, should display * and the locations for which the paring is discovered should display the letter that is on that location. In addition, the sides of the board should be labeled from 1 to p size to help the user identify which locations they want opened next. You may assume that the player will follow your instructions and will input integers when asked for location (rather than doubles or other type), but your program should test if the player entered integers in the required range and prompt her to repeat the entry until correct input is obtained. You should also fully test your program { for example, what does your program do if the player entered two locations that are already discovered, etc.

Answer

Get Essay Answer
1,200,000+ Questions
Satisfaction guaranteed