This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:fall2019:discrete:projects:mtf1 [2019/09/23 17:05] – [Objective] wedge | haas:fall2019:discrete:projects:mtf1 [2019/09/26 17:59] (current) – wedge | ||
---|---|---|---|
Line 23: | Line 23: | ||
* if it doesn' | * if it doesn' | ||
* if it exists and doesn' | * if it exists and doesn' | ||
+ | * for some operations, the result violates the properties of mathematics. In the case of such invalid results, display " | ||
+ | * for the non-associative operations, the variable driving the individual rows should be the one operated on (ie result = row - col) | ||
=====Program Output===== | =====Program Output===== | ||
+ | |||
+ | ====Default, | ||
<cli> | <cli> | ||
lab46: | lab46: | ||
- | 1 | + | |
- | x------------------------------------------------ | + | [*]--------------------------- |
- | 1 | | + | 1 | 1 2 3 4 5 6 7 8 9 |
- | 2 | | + | 2 | 2 4 6 8 10 12 14 16 18 |
- | 3 | | + | 3 | 3 6 |
- | 4 | | + | 4 | 4 8 12 16 20 24 28 32 36 |
- | 5 | | + | 5 | 5 10 15 20 25 30 35 40 45 |
- | 6 | | + | 6 | 6 12 18 24 30 36 42 48 54 |
- | 7 | | + | 7 | 7 14 21 28 35 42 49 56 63 |
- | 8 | | + | 8 | 8 16 24 32 40 48 56 64 72 |
- | 9 | 9 | + | 9 | |
- | 10 | 10 20 30 40 50 60 70 80 90 100 110 120 | + | |
- | 11 | 11 22 33 44 55 66 77 88 99 110 121 132 | + | |
- | 12 | 12 24 36 48 60 72 84 96 108 120 132 144 | + | |
</ | </ | ||
- | I hope that renders correctly- note how everything is neatly aligned in its spaced column. | + | ====Altering the operation to perform (addition)==== |
+ | < | ||
+ | lab46: | ||
+ | 1 2 3 4 5 6 7 8 9 | ||
+ | [+]--------------------------- | ||
+ | 1 | 2 3 4 5 6 7 8 9 10 | ||
+ | 2 | 3 4 5 6 7 8 9 10 11 | ||
+ | 3 | 4 5 6 7 8 9 10 11 12 | ||
+ | 4 | 5 6 7 8 9 10 11 12 13 | ||
+ | 5 | 6 7 8 9 10 11 12 13 14 | ||
+ | 6 | 7 8 9 10 11 12 13 14 15 | ||
+ | 7 | 8 9 10 11 12 13 14 15 16 | ||
+ | 8 | 9 10 11 12 13 14 15 16 17 | ||
+ | 9 | 10 11 12 13 14 15 16 17 18 | ||
+ | </ | ||
- | Altering the upper bound: | + | ====Subtraction==== |
+ | < | ||
+ | lab46:~/ | ||
+ | 1 2 3 4 5 6 | ||
+ | [-]------------------ | ||
+ | 1 | 0 -1 -2 -3 -4 -5 | ||
+ | 2 | 1 0 -1 -2 -3 -4 | ||
+ | 3 | 2 1 0 -1 -2 -3 | ||
+ | 4 | 3 2 1 0 -1 -2 | ||
+ | 5 | 4 3 2 1 0 -1 | ||
+ | 6 | 5 4 3 2 1 0 | ||
+ | </ | ||
+ | ====Division==== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | | + | 1 2 3 4 5 6 |
- | | + | |
- | 1 | 1 2 3 | + | 1 | 1 |
- | 2 | 2 | + | 2 | 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 |
- | 3 | 3 | + | 3 | 3 1 1 0 0 0 0 0 0 0 0 0 0 0 0 |
- | 4 | 4 | + | 4 | 4 |
- | 5 | 5 10 15 20 25 30 | + | |
- | 6 | 6 12 18 24 30 36 | + | 6 | 6 |
+ | | ||
+ | 8 | 8 | ||
+ | | ||
+ | A | A | ||
+ | | ||
+ | C | C | ||
+ | | ||
+ | E | E 7 4 3 2 2 2 1 1 1 1 1 1 1 0 | ||
+ | F | F 7 5 3 3 2 2 1 1 1 1 1 1 1 1 | ||
</ | </ | ||
- | Another variation (customizing | + | ====Remainder==== |
+ | < | ||
+ | lab46: | ||
+ | 1 2 3 4 5 6 7 8 | ||
+ | [%]------------------------ | ||
+ | 1 | 0 1 1 1 1 1 1 1 | ||
+ | 2 | 0 0 2 2 2 2 2 2 | ||
+ | 3 | 0 1 0 3 3 3 3 3 | ||
+ | 4 | 0 0 1 0 4 4 4 4 | ||
+ | 5 | 0 1 2 1 0 5 5 5 | ||
+ | 6 | 0 0 0 2 1 0 6 6 | ||
+ | 7 | 0 1 1 3 2 1 0 7 | ||
+ | 8 | 0 0 2 0 3 2 1 0 | ||
+ | </ | ||
+ | ====Altering | ||
+ | < | ||
+ | lab46:~/ | ||
+ | 1 2 3 4 5 6 7 | ||
+ | [*]--------------------- | ||
+ | 1 | 1 2 3 4 5 6 7 | ||
+ | 2 | 2 4 6 10 12 14 16 | ||
+ | 3 | 3 6 11 14 17 22 25 | ||
+ | 4 | 4 10 14 20 24 30 34 | ||
+ | 5 | 5 12 17 24 31 36 43 | ||
+ | 6 | 6 14 22 30 36 44 52 | ||
+ | 7 | 7 16 25 34 43 52 61 | ||
+ | </ | ||
+ | ====Altering the base, extending the upper bound==== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | | + | |
- | x------------ | + | |
- | 4 | 16 20 24 28 | + | 1 | |
- | 5 | 20 25 30 35 | + | 2 | 2 |
- | 6 | 24 30 36 42 | + | 3 | |
- | 7 | 28 35 42 49 | + | 4 | |
+ | 5 | 5 | ||
+ | 6 | 6 10 16 20 26 | ||
+ | 7 | 7 12 19 24 2B 36 41 48 53 5A 65 70 77 | ||
+ | 8 | | ||
+ | 9 | | ||
+ | A | | ||
+ | B | | ||
+ | 10 | 10 20 30 40 50 60 70 80 90 A0 B0 100 110 | ||
+ | 11 | 11 22 33 44 55 66 77 88 99 AA BB 110 121 | ||
</ | </ | ||
- | Spacing, formatting, and presentation are centrally important. I want those headers and headings, and dividing lines. Your output should match my output. | + | ====All of that, plus lower bound==== |
+ | < | ||
+ | lab46: | ||
+ | 2 3 4 5 6 7 8 | ||
+ | [*]--------------------- | ||
+ | 2 | 4 6 8 A C 11 13 | ||
+ | 3 | 6 9 C 12 15 18 1B | ||
+ | 4 | 8 C 13 17 1B 22 26 | ||
+ | 5 | A 12 17 1C 24 29 31 | ||
+ | 6 | C 15 1B 24 2A 33 39 | ||
+ | 7 | 11 18 22 29 33 3A 44 | ||
+ | 8 | 13 1B 26 31 39 44 4C | ||
+ | </ | ||
+ | |||
+ | Spacing, formatting, and presentation are centrally important. I want those headers and headings, and dividing lines. Your output should match my output | ||
An issue you might run into is how much space will you have to allocate (you want it universal for the display of the entire table). For that, I say determine the length of the maximum value being output (ie the bottom-most right value). That value’s length should then influence all the other output in the table. | An issue you might run into is how much space will you have to allocate (you want it universal for the display of the entire table). For that, I say determine the length of the maximum value being output (ie the bottom-most right value). That value’s length should then influence all the other output in the table. | ||
+ | |||
+ | =====Submission===== | ||
+ | To successfully complete this project, the following criteria must be met: | ||
+ | |||
+ | * Code must compile cleanly (no warnings or errors) | ||
+ | * Use the **-Wall** and **--std=gnu99** flags when compiling. | ||
+ | * Code must be nicely and consistently indented (you may use the **indent** tool) | ||
+ | * Code must utilize the algorithm/ | ||
+ | * Output **must** match the specifications presented above (when given the same inputs) | ||
+ | * Code must be commented | ||
+ | * be sure your comments reflect the **how** and **why** of what you are doing, not merely the **what**. | ||
+ | * Track/ | ||
+ | * Submit a copy of your source code to me using the **submit** tool. | ||
+ | |||
+ | To submit this program to me using the **submit** tool, run the following command at your lab46 prompt: | ||
+ | |||
+ | <cli> | ||
+ | $ submit discrete mtf1 mtf1.c | ||
+ | Submitting discrete project " | ||
+ | -> mtf1.c(OK) | ||
+ | |||
+ | SUCCESSFULLY SUBMITTED | ||
+ | </ | ||
+ | |||
+ | 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. |