Question: Activity A. Remove any duplicate letters from a word and display the new word maintaining the original order. For example, bananas would become bans and

Activity A. Remove any duplicate letters from a word and display the new word maintaining the original order. For example, bananas would become bans and bookkeeper would become bokepr.

Notes

You may not use the unique/remove duplicate commands Approximately 8 lines of code

Program Inputs Enter a single word:

The user will always type a word without spaces or punctuation Program Outputs

Adjusted word: XXX Replace XXX with the new word

Test Case 1:

 Enter a single word: bananas Adjusted word: bans 

Test Case 2:

 Enter a single word: bookkeeper Adjusted word: bokepr 

Test Case 3:

 Enter a single word: batman Adjusted word: batmn 

Test Case 4:

 Enter a single word: salty Adjusted word: salty 

Test Case 5:

 Enter a single word: aggressiveness Adjusted word: agresivn

Activity B. Given several jumbled lowercase letters, determine if it can be rearranged into a palindrome (a word that spells the same forwards and backwards). For example, the letters veell can be rearranged into level, which is a palindrome.

Notes

Approximately 17 lines of code

How can counting the each letter in the alphabet help? (i.e. how many as, bs, cs,

etc...)

Program Inputs Enter any lowercase letters:

The user will always enter multiple lowercase letters, no error checking needed. Program Outputs

Palindrome possible! Palindrome NOT possible...

Test Case 1:

 Enter any lowercase letters: veell Palindrome possible! 

Test Case 2:

 Enter any lowercase letters: oonn Palindrome possible! 

Test Case 3:

 Enter any lowercase letters: skyaka Palindrome NOT possible... 

Test Case 4:

 Enter any lowercase letters: uplplu Palindrome possible! 

Test Case 5:

 Enter any lowercase letters: eahccrar Palindrome NOT possible... 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!