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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:20, orlando19882000
The pyraminx is a rubik's cube-type toy in the shape of a tetrahedron (not a pyramid). the pyraminx shown below has edges 15\,\text{cm}15cm15, space, c, m long and vertical height h=12.2\,\text{cm}h=12.2cmh, equals, 12, point, 2, space, c, m. the triangle drawn with dashed lines is a right triangle. what is the distance rrr? round your answer to the nearest tenth.
Answers: 1
image
Computers and Technology, 22.06.2019 06:00, Wolfie215
Which of the following is a way that advancements in technology improve humans' ability to measure air quality and protect human health? a. air quality data gathered by new instruments can be used to reduce exposure to pollutants. b. new technologies enable natural and human-made pollution sources to be located and monitored. c. air quality data gathered by new instruments can be used to predict trends in pollution over time. d. new technologies allow governments to make informed decisions about the regulation of pollution. (choose more than one)
Answers: 2
image
Computers and Technology, 22.06.2019 23:00, maxy7347go
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
image
Computers and Technology, 23.06.2019 09:30, Princessirisperez0
Given a link with a maximum transmission rate of 32.8 mbps. only two computers, x and y, wish to transmit starting at time t = 0 seconds. computer x sends filex (4 mib) and computer y sends filey (244 kib), both starting at time t = 0. statistical multiplexing is used, with details as follows packet payload size = 1000 bytes packet header size = 24 bytes (overhead) ignore processing and queueing delays assume partial packets (packets consisting of less than 1000 bytes of data) are padded so that they are the same size as full packets. assume continuous alternating-packet transmission. computer x gets the transmission medium first. at what time (t = ? ) would filey finish transmitting? give answer in milliseconds, without units, and round to one decimal places (e. g. for an answer of 0.013777 seconds you would enter "13.8" without the quotes)
Answers: 3
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 in other subjects: