Help with a program that converts text into morse code

how too write a program that converts text in too morse cose

Page 1 of 1

5 Replies - 2822 Views - Last Post: 27 April 2009 - 08:44 AM Rate Topic: -----

#1 hatcet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-April 09

Help with a program that converts text into morse code

Post icon  Posted 23 April 2009 - 09:38 AM

Hi i realy need help im suposed too write a program that converts text in to morse code and other way around
but i dont even know where too start or how to do it.

culd anyone give me some pointers on how i culd do this plz
Is This A Good Question/Topic? 0
  • +

Replies To: Help with a program that converts text into morse code

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3116
  • View blog
  • Posts: 19,153
  • Joined: 14-September 07

Re: Help with a program that converts text into morse code

Posted 23 April 2009 - 09:41 AM

1. Read in the string by character (or read in the whole string and then iterate by character)
2. reference a table you've made that has the values of each character
3. copy data into a new string
4. display or write to file
5. profit?? ;)
Was This Post Helpful? 1
  • +
  • -

#3 hatcet  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 23-April 09

Re: Help with a program that converts text into morse code

Posted 24 April 2009 - 04:38 AM

View PostKYA, on 23 Apr, 2009 - 08:41 AM, said:

1. Read in the string by character (or read in the whole string and then iterate by character)
2. reference a table you've made that has the values of each character
3. copy data into a new string
4. display or write to file
5. profit?? ;)


Hi culd you say that one more time after dumbing it down a notch :blink:
ive been going over my books and notes but it dosnt click for me
Was This Post Helpful? 0
  • +
  • -

#4 apw5020  Icon User is offline

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 666
  • Joined: 26-March 09

Re: Help with a program that converts text into morse code

Posted 24 April 2009 - 08:47 AM

Check my "Mapping" post under C/C++ homework. I got the exact same assignment. Maybe we're in the same class?
Was This Post Helpful? 0
  • +
  • -

#5 qwerty22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-April 09

Re: Help with a program that converts text into morse code

Posted 27 April 2009 - 06:46 AM

Am require the code the program in C++


The ADFGX Field Cipher
A field cipher is one that will require little in the way of equipment or lookup table for its implementation, so relying upon readily changed keywords. Field ciphers are therefore ideally suited to military communications on battlefields. The ADFGX cipher used by the Germans in World War 1, using a blend of substitution and transposition to create messages from only five letters, and is probably the most famous in the category.
A
D
F
G
X

A
k
r
z
v
l

D
f
t
s
x
i/j

F
g
m
o
h
w

G
b
e
q
p
c

X
d
a
y
n
u

Using the grid reference the cipher text ‘field cipher’ becomes:
DA DX GD AX DA GX DX GG FG GD AD
The final mono-alphabetic substitution cipher text was written in columns headed by the keyword ‘ZEBRA’
Z
E
B
R
A

D
A
D
X
G

D
A
X
D
A

G
X
D
X
G

G
F
G
G
D

A
D

The final transposition required the message to be read in columns in alphabetic order, so ZEBRA becomes ABERZ, giving
DDGGA AAXFD DXDGY XDXGY GAGDY
Notice the use of ‘Y’ padding.

Using the above cipher am require to create a new file; this will be the plain text, that is typed in from the keyboard and formatted into a region of the screen. The characters entered should be no less that 222 and no more that 333 in number. During entry the screen should display both a running total of characters, and boundary warnings for 222 and 333. The text should be accompanied by the heading ‘Plain Text Message’.
Following entry of the plain text, it should then be processed using the encryption strategy handed out as part of the assignment, with the encrypted version displayed to the screen accompanied by the heading ‘Encrypted text Message’.
Following the display of the encrypted message, there should be an option to save the file comprising a prompt for filename. Once the name of the file has been entered and the file saved, the program should return to the main menu.
This option will allow you to open encrypted files already saved to disk. A prompt for the name of a file to open should appear and upon entry the file should open, displaying the encrypted text to a formatted region of the screen.
This should be followed by a prompt to decrypt the file. Upon confirmation, the plain text version of the file should be displayed to a formatted region of the screen.

A prompt should now appear that will allow the user to return to the main menu interface.
Was This Post Helpful? 0
  • +
  • -

#6 apw5020  Icon User is offline

  • D.I.C Addict

Reputation: 78
  • View blog
  • Posts: 666
  • Joined: 26-March 09

Re: Help with a program that converts text into morse code

Posted 27 April 2009 - 08:44 AM

View Postqwerty22, on 27 Apr, 2009 - 05:46 AM, said:

Am require the code the program in C++


The ADFGX Field Cipher
A field cipher is one that will require little in the way of equipment or lookup table for its implementation, so relying upon readily changed keywords. Field ciphers are therefore ideally suited to military communications on battlefields. The ADFGX cipher used by the Germans in World War 1, using a blend of substitution and transposition to create messages from only five letters, and is probably the most famous in the category.
A
D
F
G
X

A
k
r
z
v
l

D
f
t
s
x
i/j

F
g
m
o
h
w

G
b
e
q
p
c

X
d
a
y
n
u

Using the grid reference the cipher text ‘field cipher’ becomes:
DA DX GD AX DA GX DX GG FG GD AD
The final mono-alphabetic substitution cipher text was written in columns headed by the keyword ‘ZEBRA’
Z
E
B
R
A

D
A
D
X
G

D
A
X
D
A

G
X
D
X
G

G
F
G
G
D

A
D

The final transposition required the message to be read in columns in alphabetic order, so ZEBRA becomes ABERZ, giving
DDGGA AAXFD DXDGY XDXGY GAGDY
Notice the use of ‘Y’ padding.

Using the above cipher am require to create a new file; this will be the plain text, that is typed in from the keyboard and formatted into a region of the screen. The characters entered should be no less that 222 and no more that 333 in number. During entry the screen should display both a running total of characters, and boundary warnings for 222 and 333. The text should be accompanied by the heading ‘Plain Text Message’.
Following entry of the plain text, it should then be processed using the encryption strategy handed out as part of the assignment, with the encrypted version displayed to the screen accompanied by the heading ‘Encrypted text Message’.
Following the display of the encrypted message, there should be an option to save the file comprising a prompt for filename. Once the name of the file has been entered and the file saved, the program should return to the main menu.
This option will allow you to open encrypted files already saved to disk. A prompt for the name of a file to open should appear and upon entry the file should open, displaying the encrypted text to a formatted region of the screen.
This should be followed by a prompt to decrypt the file. Upon confirmation, the plain text version of the file should be displayed to a formatted region of the screen.

A prompt should now appear that will allow the user to return to the main menu interface.


I'm assuming you want us to code your assignment for you. Well, this website has a policy stating that we cannot do your homework for you. Give it a try, post what you have, and we can help you from there. Besides, you won't learn anything if you don't do it yourself!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1