Answered step by step
Verified Expert Solution
Link Copied!

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
1
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
2
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 #
1
checks all output
Mini Test #
2
output includes
"
=
"
for the character
Test #
3
checks all output
Mini Test #
4
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 #
5
checks all output
Mini Test #
6
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

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

More Books

Students also viewed these Databases questions

Question

define what is meant by the term human resource management

Answered: 1 week ago