Question: 2 question java coding 6. Write a Java application that accepts one String parameter from a JOptionPane inputDialog and prints to a JOptionPane messageDialog the
2 question6. Write a Java application that accepts one String parameter from a JOptionPane inputDialog and prints to a JOptionPane messageDialog the number times two digits in a row occur. For example: Input string: messageDialog says Testing 12 Two digits happen 1 times. Testing 123 Two digits happen 2 times. 123 Testing 12 23 234 Two digits happen 6 times. Hint: Recall that there is a method in the Character wrapper class: boolean Character, isDigit (char c) 7. Write a boolean method that will return true if the sum of the diagonal (upper-left to lower-right) of a two-dimension array is equal to the sum of a given row: diagonalEqualsRow ( int 1) myArray, int row) If the array is not a square matrix or the row number is out of bounds, throw an IllegalArgumentException with an appropriate message. For example: my Array1 1 3 5 7 9 231468 0 1 5 13 45278 7 6 329 my Array2 1332 4256 1 2 3 4 7894 my Array3 13 567 087 413 myArray4 1332 4 2 5 6 1234 7894 diagonal EqualsRow (myArray, 0) returns true diagonal EqualsRow (myArray2, 2) returns true diagonalEqualsRow (myArray3, 0) throw an exception - Matrix not square diagonal EqualsRow (myArray, 6) throw an exception Illegal row
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
