تم الحل ✓
categoryبرمجة وتطوير البرمجيات
schoolبكالوريوس
event_available2026-07-15
السؤال
Transcribed Image Text:
Exercises
1. You will create a class named MyString that will perform different processing on Strings
that are sent to it. All of the methods you create will be static, and the class should work in
a similar manner to the Math class. Only the four methods listed below should be public.
1) Create a method reverseString that receives a String and returns a String that is the
exact reversal of the characters in the first String.
2) Create a method is Palindrome that receives a String and returns a boolean value of true
if the String is a Palindrome and false if it is not. A word is a palindrome if it reads the
same forwards and backwards. For example, the word level is a palindrome.
The idea of a palindrome can be extended to phrases or sentences if we ignore details
like punctuation, so you need to create a method that cleans the sentence from
punctuation and spaces, then convert the sentence to lower or upper case after that we
can use the method isPalindrome with the new sentence. Here are two familiar
examples:
Madam, I'm Adam → madamimadam
A man, a plan, a canal: Panama amanaplanacanalpanama
3) Create a method ShortHnaded that receives a String and returns the String converted
into shorthand. The simplified shorthand form of a string is defined as follows:
1. Replace these four words: "and" with "&", "to" with "2", "you" with "U",
and "for" with "4".
2. Remove all vowels ('a', 'e', 'i', 'o', 'u', whether lowercase or uppercase), do
not remove 'u' and 'I' if they did not occurred in a word.
check_circle الجواب — حل مفصل خطوة بخطوة
hourglass_top
🔒
الحل الكامل متاح للمشتركين
اشترك في أرشيف الأسئلة لعرض هذا الحل وآلاف الحلول المفصلة خطوة بخطوة من معلمين معتمدين.