Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This program is part 1 of a larger program. Eventually, it will make ASCII art using a modified version of Morse code. We will be
This program is part
of a larger program. Eventually, it will make ASCII art using a modified version of Morse code. We will be making our own Art Morse Code
While a list or dictionary
or some other data structure
may be an elegant way to solve this problem, do NOT use any of them. We will have plenty of time to practice them in future chapters. Right now, we are focusing on if statements
Our Art Morse code has the following codes
Prompt the user for a code
Create a string variable. Store the corresponding character in that string variable and print the string at the end of the program. I know it is tempting to print the converted character right in the if statement, but please resist. This will help make part
simpler
If the code entered is not in the table, print invalid code. Note that because the converted string is printed at the end of the program, a string with no characters would still be printed after the invalid code line.
Test #
checks all output
Mini Test #
output includes
for the character
Test #
checks all output
Mini Test #
output includes
@
for the character
Note that there is a blank line after invalid code because the 'converted string' which is currently empty is always printed
Test #
checks all output
Mini Test #
output includes "invalid code" for invalid entered code
Did you remember to add print
after each line of input?
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