User Tools

Site Tools


haas:fall2019:discrete:projects:cnv0

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
haas:fall2019:discrete:projects:cnv0 [2019/11/05 12:26] wedgehaas: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, computes the number of factor pairs of a given number or range of numbers, displaying to STDOUT all the numbers in that range that qualify as a nary number of the specification. It is your task to write a program that, upon accepting various pieces of input from the command-line, computes the number of factor pairs of a given number or range of numbers, displaying to STDOUT all the numbers in that range that qualify as a nary number of the specification.
 +
 +=====Program run-time usage=====
 +Your program should accept command-line arguments as follows:
 +
 +<cli>
 +$ ./cnv0 NARY START END
 +</cli>
 +
 +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 number greater than or equal to 2; if in violation, display an error (to STDERR) and exit with a non-zero value. +  * process the arguments, check to make sure the numbers provided are positive numbers greater than or equal to 1 or (depending); if in violation, display an error (to STDERR) and exit with a non-zero value. 
-  * 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 as specified.
     * 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)
haas/fall2019/discrete/projects/cnv0.1572956762.txt.gz · Last modified: 2019/11/05 12:26 by wedge