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 00:00
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
question
Computers and Technology, 22.06.2019 10:30
Auniversity wants to install a client-server network. which feature do you think is important for them as they set up the network? sending email blocking multiple people to use the same file low security low set up cost limited access to files
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 23.06.2019 14:00
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
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
question
Business, 09.02.2021 02:40
question
English, 09.02.2021 02:40
Questions on the website: 13722361