1. Write a program to solve each of the following... a) input a word. Isolate the first 4 letters and...

advertisement
1. Write a program to solve each of the following problems:
a) input a word. Isolate the first 4 letters and output as capital.
b) input a sentence. Count the number times that first letter is used. Ie) Hello there H=2.
c) input a sentence. Convert first letter of each word to Uppercase letters and output.
Ie)Welcome to computer class => Welcome To Computer Class
d) input a word. Create a new word containing the letters of the original word in the reverse order. For
example, "bread" will become "daerd".
2. Write a program that prompts the user to enter a word using only lower letters. The program is to
display the location of the earliest letter of the alphabet.
For example, Input: VISUAL Output : 5, A
Input: Debug Output : 3, B
Input: upper Output : 4, e
3. Write a program which prompts the user to enter a word and a search pattern. The program is to
replace the pattern with an “X”.
Sample Input: Enter a word: KALAMAZOO
Enter a search pattern: AZ
Sample Output: KALAMXOO
4 Input a Phone Number (SIN) ie 905-456-1212
a) Add the values of the three parts (output: 905+456+1212 = 2352
b) output the frequency (how often it appears) of each of the numbers. Do not include all 10 digits.
Digit
Frequency
0 =
1
1 =
2
2 =
2
4 =
1
5 =
1
6 =
1
9 =
1
c) add the digits in the odd numbered positions
Download