Answered step by step
Verified Expert Solution
Link Copied!

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 4
Hector is in grade 3 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 1Y
h(or H) gets changed to 10
j(or J) gets changed to 1x
d (or D) gets changed to 1B
a (or A) gets changed to 1S
p(or P) gets changed to 1M
I (or I) gets changed to 1Q
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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions