Homework 9

Due date

This assignment must be submitted as two files named morse.c and translate.c for Homework 9 of the ECE 209.602 / CSCI 373.002 section on UNCA moodle by 11:00 PM on Saturday, 13 November.

The assignment as given at NC State

This programming assignment is based on the the third NCSU ECE 209.001 program assignment with minor changes marked on the handout.

Before starting this solution, you should download the following two small files which will be used as drivers for the assignment.

Your solution will have one file morse.c which will contain the main routine. The second file, translate.c will contain the char2morse and morse2char routines. file.

Running under NetBeans

To run this program under NetBeans you must know (1) how to pass arguments to a program controlled by NetBeans and (2) where to place your files.

While running NetBeans, right-click on the name of your project. Then select Properties, which should be at the bottom of the pull-down menu. This will bring up a window labeled Project Properties.

Note the name of the directory listed as the Project Location. Download the sample.txt, sample_ascii.txt, and sample_morse.txt test files into this directory.

Next press Run under the list of categories. You will see a field labeled Arguments in the right panel. Click on the little box with three dots to the right of Arguments. This will bring up a window labeled Debug - Arguments. In this box, Type either a2m or m2a followed by the names of your input and output files. For example, on your first run you might want to type more a2m sample.txt morse.txt. Be sure to Apply your changes before closing the window.

Now you should be able to run your program. If everything works well, all you'll see is a windows asking you to Press [Enter] to close the terminal....

To view the output of your program, press on NetBeans Files tab in the upper-left corner. Double-clicking your output file will allow you to view it.

Don't try to add the sample files as Test Files for your project. These are for JUnit, something you do not want to use.

The modifications for our section

  1. The due date is 13 November.
  2. Students addicted to the Java/C++ style of comments may use -std=c99 rather than -pedantic as a command line option.
  3. I've created a Moodle forum, which should be similar to the NCSU Message Board, for this assignment. If you have a specific question about your program, send a copy of your program, along with your question, to brock@cs.unca.edu.
  4. As mentioned above, completed programs are to be submitted as morse.c and translate.c and by moodle