subject

In this assignment, you are to determine if an input string is a palindrome and, if it is, what type of palindrome. a palindrome for this assignment is defined as "a number, word or phrase consisting of alphanumeric characters that reads the same frontwards and backwards while ignoring case, punctuation and white space".for this assignment, create a package named assign1 and name your file assign1.java. uml class diagram: + main (string []): void- getinputline (): string- ispalindrome (string): boolean - isemptyline (string): boolean - getpaltype (string): strinotes on the uml class diagram there is only one class, assign1. underlining the name of the variable/method in a uml class diagram indicates thatthe variable or method is static. this means that all methods are static. there are no class level variables. the main is public while the other methods are private. limitations on java classesfor this assignment, you are limited to the following java library classes.1. scanner 2. string3. characterrequired main function: here is the main method. copy this into your code and do not change it. public static void main (string [] args) { string line = getinputline(); while (! isemptyline (line)) { if (ispalindrome (line)) system. out. println ("\"" + line + "\" is a palindrome and a " + getpaltype (line)); else system. out. println ("\"" + line + "\" is not a palindrome"); line = getinputline(); } system. out. println ("end of program"); }required methods: you must write the following methods as specified to complete your program. pay attention to the name, return type and parameters. private static string getinputline ( )prompt the user to input a line of input and then read and return the line. private static boolean isemptyline(string str)return true if the parameter is empty or false otherwise. private static boolean ispalindrome (string str)return true if the string is a palindrome or false otherwise. see the pseudo-code on the next page for the logic and the restrictions on this implementation. private static string getpaltype (string str)determine the type of the palindrome and return "word", "phrase", or "number". the definition is number: only digits with white space and/or punctuation word: only alphabetic with no white space and/or punctuations phrase: anything else. ispalindrome pseudo-codenote: in the following, the symbolrepresents assignmentleft0rightposition of last character in string okay  truewhile okay and left < rightch1character in the string at position (left) if ch1 is not a digit or letterincrement left elsech2character in the string at position (right)if ch2 is not a digit or letter decrement rightelseconvert both ch1 and ch2 to upper case if ch1 = ch2increment leftdecrement right elseokay  false endifendif endifend while return okaycoding restrictionsyou may not return from or break from the inside of a loop. you may not copy the string to another string. you must stop processing as early as possible (when you find that it is or is not apalindrome).submittingusing the link on blackboard, submit your assign1.java file for grading. it will be downloaded, compiled and graded as well as checked against the online utility to check for plagiarism and similarity to other students’ work. sample input and outputenter a line of input: this is a test"this is a test" is not a palindromeenter a line of input: 12345.4321"12345.4321" is a palindrome and a number. enter a line of input: otto! "otto! " is a palindrome and a phrase. enter a line of input: able was i, ere i saw elba."able was i, ere i saw elba." is a palindrome and a phrase. enter a line of input: abba"abba" is a palindrome and a word. enter a line of input: program complete

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:10
Which are not examples of chronic or persistent stress? moving
Answers: 1
question
Computers and Technology, 24.06.2019 09:30
Atype of researcher who uses computers to make sense of complex digital data
Answers: 1
question
Computers and Technology, 24.06.2019 14:00
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
question
Computers and Technology, 25.06.2019 05:30
The police department is excited to have some new motorcycle units. one officer said that these motorcycles can go from 0 miles per hour to 80 miles per hour in just 6 seconds. the officer is describing the motorcycle's a. average speed. b. distance. c. average velocity. d. acceleration.
Answers: 1
You know the right answer?
In this assignment, you are to determine if an input string is a palindrome and, if it is, what type...
Questions
Questions on the website: 13722361