Question: Please complete the following using the showInputDialog and showMessageDialog methods in the JOptionPane class in the javax.swing library: Use the StringTokenizer class in the java.util

Please complete the following using the showInputDialog and showMessageDialog methods in the JOptionPane class in the javax.swing library:

Use the StringTokenizer class in the java.util library to isolate tokens in a string wherever there is a blank using the nextToken method, and the parseDouble method in the Double wrapper class to get three sides of a triangle and calculate the area of the triangle. Heres an example:

StringTokenizer st1 = new StringTokenizer(input1, " ");

double a = Double.parseDouble(st1.nextToken());

Use Heron's Formula:

Area of triangle = sqrt(p*(p-a)*(p-b)*(p-c)) where p = (a+b+c)/2

If the sum of any two sides is equal to or less than the third side, please put the message Invalid triangle.

Use the reverse and equalsIgnoreCase methods in the StringBuilder class to get a string, and then determine of it is a palindrome. A palindrome is a string that, if read frontwards and backwards, is the same.

1. Using the indexOf method in the String class, determine if a search string is contained inside a string to search. If so, please report the position of the search string. If the search string is not found, please indicate that the search string was not found.

Using the parseInt method with a radix of 16 argument in the Integer wrapper class, request a hex value and convert it to a decimal value

Using the split method from the String class, build a String array of tokens where each token is an address line. Split the string into tokens using a % sign. Output the address into correctly formatted address lines.

Please complete the following using the showInputDialog and showMessageDialog methods in the

String, StringBuilder, and Wrapper Classes Please complete the following using the the jaxax.swing library: 1. Use the Strine okcaizet class in the jasautil library to isolate tokens in a string wherever there is a blank using the og and showMessageDialog methods in the lOptionPane class in aextToken method, and the calculate the area of the triangle. Here's an example: parseDouble method in the Double wrapper class to get three sides of a tr Stringtekenizex st1 new StringTokenizer (inputi, "") double a = Double.parseDouble(st1.nextToken ( )); Use Heron's Formula: Area oftriangle = sqrt(p*(par(pb)*(pc)) where p3(atbto/2 If the sum of any two sides is equal to or less than the third side, please put the message "Invalid triangle" nvalid triangle |Message Enter the legths of the sides of a triangle: The area of the triangle is 6.0 OK Cancel OK 2. Use the reverse and equalsignoreCase methods in the StringBuilder class to get a string, and then determine of it is a palindrome. A palindrome is a string that, if read frontwards and backwards, is the same. abeCBA is a palindrome OKCancel oK method in the String class, determine if a search string is contained inside a string to search. If so, please report the position of the search string. If the search string is not found, please indicate that the s was not found. Enter a string to search Now, enter a search Strang: i) was found at position 16 OK Cancel Search string not nd 4. Using the parselnt method with a radix of 16 argument in the Integer wrapper class, request a hex value and convert it to a decimal value. Cancel OK 5. Using the split method from the String class, build a String array of tokens where each token is an address line. Split the string into tokens using a % sign. Output the address into correctly formatted address lines Enter an address. Separate each line with a percent sign um s mith%123 Man stunt n US 1234 John Smi 123 Main St Anytown, US 12345 Cancel pl

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