Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed2 question
java coding
6. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. How does Kiwi Experience maintain a continual customer focus?

Answered: 1 week ago