This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
haas:fall2019:discrete:projects:cnv0 [2019/11/05 12:26] – wedge | haas:fall2019:discrete:projects:cnv0 [2019/11/05 12:30] (current) – [Specifications] wedge | ||
---|---|---|---|
Line 87: | Line 87: | ||
=====Program===== | =====Program===== | ||
It is your task to write a program that, upon accepting various pieces of input from the command-line, | It is your task to write a program that, upon accepting various pieces of input from the command-line, | ||
+ | |||
+ | =====Program run-time usage===== | ||
+ | Your program should accept command-line arguments as follows: | ||
+ | |||
+ | <cli> | ||
+ | $ ./cnv0 NARY START END | ||
+ | </ | ||
+ | |||
+ | All are mandatory. If any are lacking or incorrect, display an error and exit with a non-zero value. | ||
=====Specifications===== | =====Specifications===== | ||
Line 97: | Line 106: | ||
* to STDERR, prompt for the number (range appropriate of an unsigned long int) | * to STDERR, prompt for the number (range appropriate of an unsigned long int) | ||
* properly store this in a variable of type **unsigned long int** | * properly store this in a variable of type **unsigned long int** | ||
- | * immediately after the input, check to make sure the input number is a positive | + | * process |
- | * proceed to evaluate the appropriate number range, determining whether or not it is a secondary (nary(2)) number. | + | * the nary value must be a value greater than or equal to 1 |
+ | * the starting and ending values must be greater than or equal to 2 | ||
+ | * proceed to evaluate the appropriate number range, determining whether or not it is an nary number | ||
* if it is, display the value to STDOUT in space-separated form (see execution section below for message) | * if it is, display the value to STDOUT in space-separated form (see execution section below for message) | ||
* if it is not, do not display anything related to that value (again, see execution section below) | * if it is not, do not display anything related to that value (again, see execution section below) |