CSC 161 Program #1

"Morse Code"

Our first program will convert regular text to/from Morse code.

 


Logistics

This program is worth 8 points, or 8% of your final grade. The pertinent time coordinates:

  • Assigned: Mar 29, 2005
  • Design due: Apr 5, 2005
  • Program due: Apr 12, 2005

Most of the program is a review of the concepts you covered in CSC 160, including:

  • C++ basics: loops, if/else, functions, etc.
  • Classes
  • Arrays
  • Strings
  • Basic file operations
  • Basic stream I/O and formatting
  • Multiple file programs
  • Using our MinGW C++ development environment
You may also incorporate some new C++ goodies, such as:
  • static class members

 



Description

The "Morse Code" program (Morse) provides a utility to convert from regular text to Morse code and visa versa. Via a text menu interface, Morse should  provide ways to:
  • Convert a single character of text to Morse code
  • Convert a line of text to Morse code
  • Convert a file of text to Morse code
  • Convert a single Morse code character to text
  • Convert a line of Morse code characters to text
  • Convert a file of Morse code to text
For our purposes, we'll use Morse code is a simple mapping of the English alphabet onto dash (-) and dot (.) characters. Here's a nice alphabet you can use:
http://www.babbage.demon.co.uk/morseabc.html

Some issues:
  • From the web page above, I assumed that "Fullstop" meant period and "Query" meant question mark.
  • What should Morse do if it encounters a character that it doesn't recognize? Oh, an exclamation point, for example. I think that ignoring it should be OK.
  • In regular Morse code, characters are separated by 1 time unit, and words by 3 time units. So for our text, let's separate characters by 1 blank space and words by 3 blank spaces.
  • The text->Morse code->text or Morse->text->Morse loops should work correctly.
  • Morse code is case insensitive. Morse should convert 'A' and 'a' to the same sequence.

 


Grading

Your program will be graded on three areas:
  • Design, 25%
  • Quality, 25%
  • Function, 50%
Each of these areas is discussed in the handout: CSC 161 Program Design, Style and Testing.

 


Notes

Mar 29
I'll add hints and other stuff here as they come up. Here's an example:
  • There's an awfully nice (and applicable?) text menu example in our text, page 340.

film at eleven... yow, bill