Homework 3:

Short Description:

This assignment is worth 10 points.

Goals

When you finish this homework, you should

Formal Description

Write a program that will produce a set of integers. Please call your program counter.

By default counter should print the numbers 1 through 10 on a line separated by spaces. There should be no space after the final number.

The program should respond to the following command line arguments.

You should parse all command line arguments before taking any actions. Values can be replaced by subsequent arguments. For example

counter -l 1 -l2 --low=4 
Should count from 4 to 10 producing the output
4 5 6 7 8 9 10

You should never print a value lower than the low value or higher than the high value.

You should always print the starting value (low for normal and high for reverse mode).

If settings conflict after all arguments are parsed, you should print a message explaining the error and exit. For example if the low value is greater than the high value, an error should be printed and no output produced. Please print all errors to cerr, not cout.

For verbose mode:

Submission

Email a copy of the C code to complete the final task to your instructor by class time. If your code consists of a single file, the source code will be sufficient, if the code is in multiple files, you should submit a tar file containing the source code and a make configuration file required to build the project.