User Tools

Site Tools


haas:fall2020:cprog:projects:cnv0

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
haas:fall2020:cprog:projects:cnv0 [2020/10/08 08:17] wedgehaas:fall2020:cprog:projects:cnv0 [2020/10/08 11:04] (current) – [Submission] wedge
Line 89: Line 89:
  
 Because there are 3 factor pairs, 12 would be considered an nary(3) value (or a tertiary number). Because there are 3 factor pairs, 12 would be considered an nary(3) value (or a tertiary number).
 +
 +=====grabit=====
 +There is a grabit for this project, which will provide you with some files pertinent for performing this project.
 +
 +Run '**grabit**' on lab46 in the appropriate manner to obtain the files.
 +
 +=====Compiling=====
 +Since there is a provided Makefile in the project grabit, we can use that to compile, either regularly:
 +
 +<cli>
 +yourpi:~/src/cprog/cnv0$ make
 +</cli>
 +
 +Or, with debugging support:
 +
 +<cli>
 +yourpi:~/src/cprog/cnv0$ make debug
 +</cli>
 +
 =====Program===== =====Program=====
 It is your task to write a program that, upon accepting various pieces of input from the user, computes the number of factor pairs of a given number, displaying its eligibility as a secondary number. It is your task to write a program that, upon accepting various pieces of input from the user, computes the number of factor pairs of a given number, displaying its eligibility as a secondary number.
Line 98: Line 117:
   * have consistent, well-defined indentation (no less than 4 spaces per level of indentation)   * have consistent, well-defined indentation (no less than 4 spaces per level of indentation)
     * all code within the same scope aligned to its indentation level     * all code within the same scope aligned to its indentation level
-  * have proximal comments explaining your rationale and what is going on, throughout your code+  * have proximal comments explaining your rationale (the why and how), throughout your code
   * 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**
Line 114: Line 133:
 ====Secondary number output==== ====Secondary number output====
 <cli> <cli>
-lab46:~/src/c4eng/cnv0$ ./cnv0+yourpi:~/src/cprog/cnv0$ ./cnv0
 Enter a number: 6 Enter a number: 6
 6 is a secondary number 6 is a secondary number
-lab46:~/src/c4eng/cnv0$ +yourpi:~/src/cprog/cnv0$ 
 </cli> </cli>
  
 ====Non-secondary number output==== ====Non-secondary number output====
 <cli> <cli>
-lab46:~/src/c4eng/cnv0$ ./cnv0+yourpi:~/src/cprog/cnv0$ ./cnv0
 Enter a number: 7 Enter a number: 7
 7 is NOT a secondary number 7 is NOT a secondary number
Line 129: Line 148:
 ====Additional outputs==== ====Additional outputs====
 <cli> <cli>
-lab46:~/src/c4eng/cnv0$ ./cnv0+yourpi:~/src/cprog/cnv0$ ./cnv0
 Enter a number: 8 Enter a number: 8
 8 is a secondary number 8 is a secondary number
-lab46:~/src/c4eng/cnv0$ ./cnv0+yourpi:~/src/cprog/cnv0$ ./cnv0
 Enter a number: 16 Enter a number: 16
 16 is NOT a secondary number 16 is NOT a secondary number
-lab46:~/src/c4eng/cnv0$ ./cnv0+yourpi:~/src/cprog/cnv0$ ./cnv0
 Enter a number: 21 Enter a number: 21
 21 is a secondary number 21 is a secondary number
-lab46:~/src/c4eng/cnv0$ +yourpi:~/src/cprog/cnv0$ 
 </cli> </cli>
  
 The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate. The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate.
- 
-=====Compiling===== 
-As we have been doing all along, use the following options to gcc when compiling: 
- 
-<cli> 
-lab46:~/src/c4eng/cnv0$ gcc -Wall --std=gnu99 -o cnv0 cnv0.c 
-lab46:~/src/c4eng/cnv0$  
-</cli> 
  
 =====Reference===== =====Reference=====
-In the C4ENG public directory, inside the **cnv0** subdirectory, will be a copy of my implementation (in executable form, by the name **ref_cnv0**), which abides by the project specifications. Please compare its output against that of your implementation.+Copied as part of the grabit, inside your **cnv0/** subdirectory, will be a copy of my implementation (in executable form, by the name **ref_cnv0**), which abides by the project specifications. Please compare its output against that of your implementation. You can invoke the reference implementation by running the following:
  
 <cli> <cli>
-lab46:~/src/c4eng/cnv0$ /var/public/fall2019/c4eng/cnv0/ref_cnv0+yourpi:~/src/cprog/cnv0$ make check
 Enter a number: 6 Enter a number: 6
 6 is a secondary number 6 is a secondary number
-lab46:~/src/c4eng/cnv0$ +yourpi:~/src/cprog/cnv0$ 
 </cli> </cli>
 +
 =====Verification===== =====Verification=====
-In addition, I have also placed a **cnv0verify** script in that same subdirectory, which will test your program against a range of values, to determine overall correctness.+In addition, I have also placed a **cnv0verify** script in that same subdirectory, which will test your program against a range of values, to determine overall correctness. You can run the verify script using the Makefile, as follows:
  
 <cli> <cli>
-lab46:~/src/c4eng/cnv0$ /var/public/fall2019/c4eng/cnv0/cnv0verify+yourpi:~/src/cprog/cnv0$ make verify
 [  1] you have: err, should be: err    [  2] you have:  no, should be:  no [  1] you have: err, should be: err    [  2] you have:  no, should be:  no
 [  3] you have:  no, should be:  no    [  4] you have: yes, should be: yes [  3] you have:  no, should be:  no    [  4] you have: yes, should be: yes
Line 183: Line 195:
 [ 33] you have: yes, should be: yes    [ 34] you have: yes, should be: yes [ 33] you have: yes, should be: yes    [ 34] you have: yes, should be: yes
 [ 35] you have: yes, should be: yes    [ 36] you have:  no, should be:  no [ 35] you have: yes, should be: yes    [ 36] you have:  no, should be:  no
-lab46:~/src/c4eng/cnv0$ +yourpi:~/src/cprog/cnv0$ 
 </cli> </cli>
 +
 =====Submission===== =====Submission=====
 To successfully complete this project, the following criteria must be met: To successfully complete this project, the following criteria must be met:
Line 200: Line 213:
  
 <cli> <cli>
-$ submit c4eng cnv0 cnv0.c +lab46:~/src/cprog/cnv0make submit
-Submitting c4eng project "cnv0": +
-    -> cnv0.c(OK) +
- +
-SUCCESSFULLY SUBMITTED+
 </cli> </cli>
 +
 +And make sure you get no error messages.
  
 You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches. You should get some sort of confirmation indicating successful submission if all went according to plan. If not, check for typos and or locational mismatches.
Line 212: Line 223:
  
 <code> <code>
-78:cnv0:final tally of results (78/78)+91:cnv0:final tally of results (91/91) 
 +*:cnv0:resources obtained via grabit by Sunday before deadline [13/13]
 *:cnv0:proper error checking and status reporting performed [13/13] *:cnv0:proper error checking and status reporting performed [13/13]
 *:cnv0:correct variable types and name lengths used [13/13] *:cnv0:correct variable types and name lengths used [13/13]
haas/fall2020/cprog/projects/cnv0.1602159431.txt.gz · Last modified: 2020/10/08 08:17 by wedge