Академический Документы
Профессиональный Документы
Культура Документы
ITM14F&G LT3
Instructions:
1. This is a hands-on group test. You are only allowed to talk to your groupmates.
2. Open notes. No internet.
3. This test is composed of 7 problems. You must save your programs in separate excel
files. Hence, you will be submitting 7 files at the end of test.
4. Save your excel files as
[ProblemName]_ [IDNumberofMember1] _ [IDNumberofMember5].xlsm
Sample: MakeAPalindrome_090416_090417_090418_090419_090420.xlsm
I. MakeAPalindrome (20pts)
Assuming the given string is composed of lowercase letters of a-z only, a palindromic string,
or a palindrome reads the same both ways. For example, abcba is a palindrome, while abc
is not a palindrome.
Characters can be added at the end of the string to make it a palindrome. For example, ab is
not a palindrome, but you can add a to from aba, which is a palindrome.
Given a string, create a function to find its palindrome conversion using the minimum
number of inserted characters.
Sample Input
ab
aa
abbey
dddaale
Output
aba
aa
abbeyebba
dddaalelaaddd
Output
TRUE
FALSE
FALSE
Output
hohoho
abcde
N/A
abcabcabcabc
V. Anagram (30pts)
Write a sub procedure generate all possible words from a given set of letters. Generate
the output in COLUMN A of your worksheet
Example: Given the word "abc", your program should - by exploring all different combination of
the three letters - output the words "abc", "acb", "bac", "bca", "cab" and "cba".
Assume that the input string is composed of uppercase and lowercase letters from a-z only.
Output
123456789
123456789
864197532
864197532
1234
1234
3087
3582
6174
6174
444
444
0
0
Additional Explanation:
Original number was 123456789
987654321 - 123456789 = 864197532
987654321 - 123456789 = 864197532
Original number was 1234
4321 - 1234 = 3087
8730 - 378 = 8352
8532 - 2358 = 6174
7641 - 1467 = 6174
Original number was 444
444 - 444 = 0
0-0=0