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 03:50
You are working as a security analyst in a company xyz that owns the whole subnet range of 23.0.0.0/8 and 192.168.0.0/8. while monitoring the data, you find a high number of outbound connections. you see that ip's owned by xyz (internal) and private ip's are communicating to a single public ip. therefore, the internal ip's are sending data to the public ip. after further analysis, you find out that this public ip is a blacklisted ip, and the internal communicating devices are compromised. what kind of attack does the above scenario depict?
Answers: 3
question
Computers and Technology, 22.06.2019 10:30
How can a user open a blank presentation? 1.on the file menu, click new, and then click recent templates 2.on the file menu, click new, and then click blank presentation 3. on the view menu, click templates, and then click recent templates 4. on the view menu, click samples, and then click blank presentation
Answers: 1
question
Computers and Technology, 23.06.2019 01:40
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
question
Computers and Technology, 23.06.2019 02:50
Define a class named movie. include private fields for the title,year, and name of the director. include three public functions withprototypes void movie: : settitle(cstring); , voidmovie: : setyear(int); , void movie: : setdirector(string); . includeanother function that displays all the information about a movie.write a main() function that declares a movie object namedmyfavoritemovie. set and display the object's fields.this is what i have but know its wrong since it will notcompile: #include#includeusing namespace std; //class declarationclass movie{private: string movietitle ; string movieyear; string directorname; public: void settitle(string title); void setyear(string year); void setdirector(string director); void displayinfo(); }; //class implementationvoid movie: : settitle(string title){ movietitle = title; cout< < "what is the title of themovie? "< > temp; myfavoritemovie.settitle(temp); cout< < "enter movie year"< > temp; myfavoritemovie.setyear(temp); cout< < "enter director'sname"< > temp; myfavoritemovie.setdirector(temp); //display all the data myfavoritemovie.displayinfo(); system("pause"); return 0; this code is not entirely mine someone on cramster edited my firstcode but then i try manipulating the new code and i still get acompile error message : \documents\visual studio 2008\projects\movie\movie\movie.cpp(46) : error c2679: binary '< < ' : no operator found which takes aright-hand operand of type 'std: : string' (or there is no acceptableconversion)c: \program files (x86)\microsoft visual studio9.0\vc\include\ostream(653): could be'std: : basic_ostream< _elem,_traits> & std: : operator< < > (std: : basic_ostream< _elem,_traits> & ,const char *)w
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: 13722363