Java Programming
Write a program that does the following:- reads three integers from the `args` array (in this order): the rule number, the number of iterations and the width of the automaton to display- prints the state of a Rule N automaton of the given width for the given number of iterations- the starting state of the automaton should have one 'on' cell in the center (if the width is even, start with the cell to the right of the center line turned on)- if a cell is on the edge of the array, consider its left/right neighbor always 'off'- use X to indicate an 'on' cell and O to indicate an 'off' cell- if the number of iterations is 0, you should write the starting state
### Sample executions
Input: `110 10 20`
Output:
```OOOOOOOOOOXOOOOOOOOOOOOOOOOOOXXOOOOOOOOOOOOOOOOOXXXOOOOOOOOOOOOOOOOXXOXOOOOOOOOOOOOOOOXXXXXOOOOOOOOOOOOOOXXOOOXOOOOOOOOOOOOOXXXOOXXOOOOOOOOOOOOXXOXOXXXOOOOOOOOOOOXXXXXXXOXOOOOOOOOOOXXOOOOOXXXOOOOOOOOO```
Input: `110 0 20`
```OOOOOOOOOOXOOOOOOOOO```
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here