| |
L.A.13.2 - Shorthand | page 11 of 12 |
"t s bttr 2 rmn slnt & thght fl, thn 2 spk p & rmv ll dbt." - A. Lincoln
Assignment:
Write a program that repeatedly accepts a line of input and produces the shorthand form of that line.
The shorthand form of a string is defined as follows:
- replace these four words: "and" with "&", "to" with "2", "you" with "U", and "for" with "4".
- remove all vowels ('a', 'e', 'i', 'o', 'u', whether lowercase or uppercase)
Your program should keep prompting the user for strings and printing out the shorthand version until the user enters "Q" or "q" (which will signal termination of the program).
Instructions:
Use these sample phrases as inputs for your run outputs:
You can pretend to be serious; you can't pretend to be witty
for For to you YOU and TO and
Humuhumunukunukuapua'a - Hawaiian state fish
2 + 2 = 4
This is FOR YOU TO try AND convert.
Here are sample run outputs
Welcome to the Shorthand Message Generator!
Enter a message: You can pretend to be serious; you can't pretend to be witty
U cn prtnd 2 b srs; U cn't prtnd 2 b wtty
Enter a message: for For to you YOU and TO and
4 4 2 U U & 2 &
Enter a message: Humuhumunukunukuapua'a - Hawaiian state fish
Hmhmnknkp' - Hwn stt fsh
Enter a message: 2 + 2 = 4
2 + 2 = 4
Enter a message: This is FOR YOU TO try AND convert.
Ths s 4 U 2 try & cnvrt.
Enter a message: Q
Turn in your source code and run outputs.
|