Computers and Technology

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

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, haileesprague575
Quic which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
image
Computers and Technology, 23.06.2019 20:40, bobby3350
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
image
Computers and Technology, 23.06.2019 23:40, lexiecooley
4. what is the reason for including the following code snippet in the header file animal. h? #ifndef animal_h #define animal_h class animal { public: animal(); animal(double new_area_hunt); void birth(); void hunt(double new_area_hunt); void death(); double get_area_hunt() const; private: double area_hunt; }; #endif
Answers: 3
image
Computers and Technology, 24.06.2019 07:00, jared2461
Jean has kept the content of her website limited to what is important; she has also ensured that the text follows a particular style and color all throughout her website. which website features has jean kept in mind? jean has limited the content of her website to what is important; this ensures (clarity, simplicity, harmony and unity) of the content. she has also formatted the text in a particular style and color throughout her website, ensuring (balance, simplicity, consistency)
Answers: 2
Do you know the correct 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:

Konu
World Languages, 23.09.2019 04:20
Konu
Mathematics, 23.09.2019 04:20