Question
String Processin To begin: In Eclipse create a Scala project called StringLab Add a worksheet to this project called stringsession Add a Scala interpreter to
String Processin To begin: In Eclipse create a Scala project called StringLab Add a worksheet to this project called stringsession Add a Scala interpreter to this project In the session worksheet define and test the following functions. Your implementations should be as concise as possible. You should use library functions whenever possible. You should use operator symbols whenever possible. Hint it's helpful to know that Instances of the String class are implicitly converted into instances of To end: Export session sc to your file system and send it to the grader by the deadline. i. Problem Write and test a simple palindrome detector ie Pal rotator\") true e Pal false Pal should ignore leading and trailing whitespace. It should also be case insensitive. It should work even if the string contains characters ot etter5. 2, Problem Enhance isPal by making a function isPal2 that ignore case, punctuation. and white space iaPa12 A man, a plan, a canal Panama. true Hint: filter out undesirable characters. then use the function defined in #1. Write and test a palindrome c onstructor: Pal 4, Problem Write a random word generator: val al al String 121*121 val a2 a2 String val a3 mkword. a3 String Sgaecegi. val a 20 a String Note: Words only contain lowercase letters. The average length should be approximately the average length of words in an English dictionary.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started