This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2020:cprog:projects:cnv1 [2020/10/08 13:40] – wedge | haas:fall2020:cprog:projects:cnv1 [2020/10/15 12:49] (current) – [Determining factor pairs] wedge | ||
---|---|---|---|
Line 10: | Line 10: | ||
=====Reading===== | =====Reading===== | ||
- | In [[https://lab46.g7n.org/_media/haas/the_c_book.pdf|"The C Book"]], please read through Chapter 8. | + | In "The C Book", please read through Chapter 8. |
+ | |||
+ | Review needed concepts in [[https://www.tutorialspoint.com/cprogramming/|this tutorial]] and also [[https://www.cprogramming.com/ | ||
=====Background===== | =====Background===== | ||
Line 87: | 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). | ||
+ | |||
+ | ====Command-line arguments==== | ||
+ | {{page> | ||
+ | |||
+ | =====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===== | ||
Line 123: | Line 146: | ||
====Primary number (nary(1)) output==== | ====Primary number (nary(1)) output==== | ||
<cli> | <cli> | ||
- | lab46: | + | yourpi: |
11 13 17 19 23 | 11 13 17 19 23 | ||
- | lab46: | + | yourpi: |
</ | </ | ||
====Secondary number (nary(2)) output==== | ====Secondary number (nary(2)) output==== | ||
<cli> | <cli> | ||
- | lab46: | + | yourpi: |
4 6 8 9 10 | 4 6 8 9 10 | ||
- | lab46: | + | yourpi: |
</ | </ | ||
====Tertiary number (nary(3)) output==== | ====Tertiary number (nary(3)) output==== | ||
<cli> | <cli> | ||
- | lab46: | + | yourpi: |
- | 12, 16, 18, 20, 28, 32 | + | 12 16 18 20 28 32 |
- | lab46: | + | yourpi: |
</ | </ | ||
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 CPROG public directory, inside the **cnv0** subdirectory, | + | In the CPROG public directory, inside the **cnv1/** subdirectory, |
<cli> | <cli> | ||
- | lab46: | + | yourpi: |
- | 4 6 8 9 10 14 15 21 22 25 26 27 33 34 35 38 39 | + | n-ary(1) from 2 to 50: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 |
- | lab46:~/ | + | n-ary(2) from 2 to 50: 4 6 8 9 10 14 15 21 22 25 26 27 33 34 35 38 39 46 49 |
+ | n-ary(3) from 2 to 50: 12 16 18 20 28 32 44 45 50 | ||
+ | n-ary(4) from 2 to 50: 24 30 40 42 | ||
+ | n-ary(5) from 2 to 50: 36 48 | ||
</ | </ | ||
- | |||
=====Verification===== | =====Verification===== | ||
- | In addition, I have also placed a **cnv0verify** script in that same subdirectory, | + | In addition, I have also placed a **cnv1verify** script in that same subdirectory, |
<cli> | <cli> | ||
- | lab46: | + | yourpi: |
ERROR CHECK | ERROR CHECK | ||
================= | ================= | ||
Line 215: | Line 234: | ||
need: >36 < | need: >36 < | ||
- | lab46: | + | yourpi: |
</ | </ | ||
Line 233: | Line 252: | ||
<cli> | <cli> | ||
- | $ submit | + | lab46: |
- | Submitting cprog 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 245: | Line 262: | ||
< | < | ||
- | 78:cnv0:final tally of results (78/78) | + | 91:cnv1:final tally of results (91/91) |
- | *:cnv0:proper error checking and status reporting performed [13/13] | + | *:cnv1: |
- | *:cnv0:correct variable types and name lengths used [13/13] | + | *:cnv1:proper error checking and status reporting performed [13/13] |
- | *:cnv0:proper output formatting per specifications [13/13] | + | *:cnv1:correct variable types and name lengths used [13/13] |
- | *:cnv0:runtime tests of submitted program succeed [13/13] | + | *:cnv1:proper output formatting per specifications [13/13] |
- | *:cnv0:no negative compiler messages for program [13/13] | + | *:cnv1:runtime tests of submitted program succeed [13/13] |
- | *:cnv0:code is pushed to lab46 repository [13/13] | + | *:cnv1:no negative compiler messages for program [13/13] |
+ | *:cnv1:code is pushed to lab46 repository [13/13] | ||
</ | </ | ||