Question: Question 4 : C + + Hector is in grade 3 and likes a girl in his class, Julia, very much. He has written a
Question : C
Hector is in grade and likes a girl in his class, Julia, very much. He has written a letter to her,
but he needs you to help him to encode the letter, so that if someone in the class gets hold of it
they would not be able to understand it Write a program that reads an input file with the letter
character by character. Change the following characters:
t or T gets changed to Y
h or H gets changed to O
j or J gets changed to X
d or D gets changed to B
a or A gets changed to S
p or P gets changed to M
I or I gets changed to Q
The rest of the characters remain the same. Read the file character by character, and write the
character if it stays the same to the output file, or write the changed version to the output file.
Call your output file encode.txt
Create an input file called letter.txt with Hectors letter:
Dear Julia,
You are the most beautiful girl that I have ever seen. I was wondering
if you would like to come and visit me My mother will make us
pancakes with ice cream. My dog, Bella, just had three beautiful puppies.
Mom says I may only keep one of them. I would like you to help me
choose one, because they are all so cute and adorable. And just
because you are my special friend, you may also have one if you want.
Your friend,
Hector.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
