Java Assignment

See screenshots at the bottom of the page

Order Description

Objective:

Create a Java program to develop skills implementing Java syntax, including:

 Compile and run a simple program Design a class definitions

 Create class methods

 Develop String manipulation techniques

 Utilize methods in the String and Character classes

Overview:In this assignment you will create a graphical Java application. Using this application user will be able to perform some analysis on text. The analysis will allow the user to check if the data entered is a palindrome and will also report several other statistics of the usage of the characters that comprises the entered data.

Helpful tip:

There are several Java classes that you may find useful for this application. These classes are String, StringBuffer, StringBuilder and Character. The documentation for these classes can be found in the Java documentation on the Oracle site under the Java.lang package. (See http://docs.oracle.com/javase/8/docs/api/)

Steps:

1. Create a new project and add a JFrame that you will use to design the graphicalinterface for the user.

a. Add a textArea that the user will enter the text to be analyzed.

b. Add one button to trigger that analysis of the text.

c. Add enough labels to display the results from the methods described below.

2. Create a private method named isPalindrome. It should take a String as an argumentand return a boolean result that indicates if the string is a palindrome (true – is apalindrome; false – is NOT a palindrome). Please remove any non-alphabetic and nondigits characters as well as all whitespace and ignore the case of the characters whendetermining if the string is indeed a palindrome.

3. Create a private method stringStats. It should take a String as an argument and thenreturns an array of int. This function needs to calculate the following statistics andreturn them in the following order:

a. number of alphabetic characters

b. number of numeric digits

c. number of control characters (ACSII characters from 0 to 31)

d. number of lower case characters

e. number of upper case characters

f. number of whitespace characters

4. Add an event to the button and call both of the above methods passing the text of thetextArea. Using the result of the isPalindrome method display the results on the form ina clear manner. Using the returned array that is sent back from the stringStats methoddisplay the statistics of the characters used in the textArea.

5. Test your application thoroughly to be sure it is working accurately. It may be difficultto enter control characters but you should find that the program will find some withoutmuch effort.

Screenshots