Question: Java Program: Your assignment is to: 1 . RubikFace - Add a ( 3 times 3 ) array to RubikFace that will

Java Program:
Your assignment is to:
1. RubikFace - Add a \(3\times 3\) array to RubikFace that will hold the colors for each of the 9 facets on the face. For now, set each of the facets to be the same color as the face. You will also have to modify the toString method to return a \(3\times 3\) grid of colors. If, for example, the color of the face was Red, your toString method should return:
R R R
R R R
R R R
2. Update any methods in RubikRunner or RubikCube that require updating as a result of this change.
3. Starting with this activity, you need to comment on your code.
Sample Run
```
W W W
W W W
W W W
B B B O O O G G G
B B O O O G G G
B B B O O O G G G
Y Y Y
Y Y Y
Y Y Y
R R R
R R R
R R R
What direction? q to quit
What direction [right, left, up, down]: left
W W W
W W W
W W W
O O O G G GRRRR
O O O G G G R R R
O O O G G G R R R
Y Y Y
Y Y Y
Y Y Y
B B B
B B B
B B B
``````
public class RubikFace
{
private String color;
public RubikFace(String _color)
{
color =_color;
}
public String toString()
{
}
return color.substring(0,1);
}
```
Java Program: Your assignment is to: 1 .

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 Programming Questions!