Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4 Hector is in grade 3 and likes a girl in his class, Julia, very much. He has written a letter to her, but
Question
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:
or gets changed to
or gets changed to
or J gets changed to
d or D gets changed to
a or gets changed to
or P gets changed to
I or I gets changed to
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 Hector's 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started