Recitation - Introduction to Computer Programming | CS 0007, Quizzes of Computer Science

Material Type: Quiz; Class: INTRO TO COMPUTER PROGRAMMING; Subject: Computer Science; University: University of Pittsburgh; Term: Unknown 1989;

Typology: Quizzes

Pre 2010

Uploaded on 09/02/2009

koofers-user-onc
koofers-user-onc 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 0007 : Recitation 8
Consider the following table. It has the translation from English letters to Morse code
A .-
B -...
C -.-.
D -..
E .
F ..-.
G --.
H ....
I ..
J .---
K -.-
L .-..
M --
N -.
O ---
P .--.
Q --.-
R .-.
S ...
T -
U ..-
V ...-
W .--
X -..-
Y -.--
Z --..
Write a program that would allow the user to enter a sentence and display the
entered sentence in Morse code. Then it allows the user to draw by entering the
x and y coordinates as in the following
pf2

Partial preview of the text

Download Recitation - Introduction to Computer Programming | CS 0007 and more Quizzes Computer Science in PDF only on Docsity!

CS 0007 : Recitation 8

Consider the following table. It has the translation from English letters to Morse code A .- B -... C -.-. D -.. E. F ..-. G --. H .... I .. J .--- K -.- L .-.. M --

N -.

O ---

P .--.

Q --.-

R .-.

S ...

T -

U ..-

V ...-

W .--

X -..-

Y -.--

Z --..

Write a program that would allow the user to enter a sentence and display the entered sentence in Morse code. Then it allows the user to draw by entering the x and y coordinates as in the following

Please Enter a String lolo String LOLO in Morse Code is :

. -.. - - -. -.. - - - Do you want to draw?y Enter the x coordinate: 1 Enter the y coordinate: 2 Do you want to continue drawing? y Enter the x coordinate: 2 Enter the y coordinate: 2 Do you want to continue drawing? y Enter the x coordinate: 3 Enter the y coordinate: 2 Do you want to continue drawing? y Enter the x coordinate: 3 Enter the y coordinate: 3 Do you want to continue drawing? y Enter the x coordinate: 3 Enter the y coordinate: 4 Do you want to continue drawing? y Enter the x coordinate: 3 Enter the y coordinate: 5 Do you want to continue drawing? n This is what you drew: .......... ..-....... ..-....... ..----.... .......... .......... .......... .......... .......... ..........