Lab18B

1. Write a new program called Lab18B that will read strings from a text file and turn them into “encrypted code”. (This will be for 10 pts extra credit, if it is completed & works.)
a. Create a bool function called isVowel that accepts a character as a parameter and returns a true if it’s a vowel (aeiou) and false otherwise.
b. Create a string function named encrypt that will accept a string variable as a parameter and return the string with all the vowels deleted from it and a * in place of every space. Use the isVowel function inside your loop here.
(Ex – Rainy days and Mondays would become Rny*dys*nd*Mndys)
c. In the main function do the following:
i. Read an unknown number of strings from the text file (Lab18B.txt). Use getline to do this because the strings should include spaces.
ii. Follow the flowchart below to design your main function
iii. Make sure to include labels for everything printed, and print a blank line before you read a new string from the text file.

×
New Download