JAVA MATRIX QUESTION

JAVA MATRIX QUESTION

Nine coins are placed in a 3×3 matrix with some face up and some face down. You can represent the state of the coins using a 3×3 matrix withvalues  0 (heads) and 1 (tails). Here are some examples:

0 0 0 1 0 1 1 1 0
0 1 0 0 0 1 1 0 0
0 0 0 1 0 0 0 0 1

Each state can also be represented using a binary number. For example, the preceding matrices correspond to the numbers:

000010000 101001100 110100001

There are a total of 512 possibilities, so you can use decimal numbers 0, 1, 2, 3,…,511 to represent all the states of the matrix. 

Write a program  that prompts the user to enter a number between  0 and 511 and displays the corresponding matrix with the characters  H and T.

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper