haas:fall2020:cprog:projects:cnv0
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:cprog:projects:cnv0 [2020/10/08 08:17] – wedge | haas: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 ' | ||
+ | |||
+ | =====Compiling===== | ||
+ | Since there is a provided Makefile in the project grabit, we can use that to compile, either regularly: | ||
+ | |||
+ | <cli> | ||
+ | yourpi: | ||
+ | </ | ||
+ | |||
+ | Or, with debugging support: | ||
+ | |||
+ | <cli> | ||
+ | yourpi: | ||
+ | </ | ||
+ | |||
=====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 |
* 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/ | + | yourpi:~/src/cprog/ |
</ | </ | ||
====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/ | + | yourpi:~/src/cprog/ |
</ | </ | ||
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: | ||
- | lab46: | ||
- | </ | ||
=====Reference===== | =====Reference===== | ||
- | In the C4ENG public directory, inside | + | Copied as part of the grabit, inside |
<cli> | <cli> | ||
- | lab46:~/src/c4eng/ | + | yourpi:~/src/cprog/ |
Enter a number: 6 | Enter a number: 6 | ||
6 is a secondary number | 6 is a secondary number | ||
- | lab46:~/src/c4eng/ | + | yourpi:~/src/cprog/ |
</ | </ | ||
+ | |||
=====Verification===== | =====Verification===== | ||
- | In addition, I have also placed a **cnv0verify** script in that same subdirectory, | + | In addition, I have also placed a **cnv0verify** script in that same subdirectory, |
<cli> | <cli> | ||
- | lab46:~/src/c4eng/ | + | yourpi:~/src/cprog/ |
[ 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/ | + | yourpi:~/src/cprog/ |
</ | </ | ||
+ | |||
=====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 | + | lab46: |
- | Submitting c4eng project " | + | |
- | -> cnv0.c(OK) | + | |
- | + | ||
- | SUCCESSFULLY SUBMITTED | + | |
</ | </ | ||
+ | |||
+ | 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: | ||
< | < | ||
- | 78:cnv0:final tally of results (78/78) | + | 91:cnv0:final tally of results (91/91) |
+ | *: | ||
*: | *: | ||
*: | *: |
haas/fall2020/cprog/projects/cnv0.1602159431.txt.gz · Last modified: 2020/10/08 08:17 by wedge