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:28] – [Program Output] 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===== | ||
Line 44: | Line 45: | ||
====Altering the operation to perform (addition)==== | ====Altering the operation to perform (addition)==== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 | ||
[+]--------------------------- | [+]--------------------------- | ||
Line 58: | Line 59: | ||
</ | </ | ||
+ | ====Subtraction==== | ||
+ | <cli> | ||
+ | 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> | ||
+ | lab46: | ||
+ | 1 2 3 4 5 6 7 8 9 A B C D E F | ||
+ | [/ | ||
+ | 1 | 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
+ | 2 | 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | ||
+ | 3 | 3 1 1 0 0 0 0 0 0 0 0 0 0 0 0 | ||
+ | 4 | 4 2 1 1 0 0 0 0 0 0 0 0 0 0 0 | ||
+ | 5 | 5 2 1 1 1 0 0 0 0 0 0 0 0 0 0 | ||
+ | 6 | 6 3 2 1 1 1 0 0 0 0 0 0 0 0 0 | ||
+ | 7 | 7 3 2 1 1 1 1 0 0 0 0 0 0 0 0 | ||
+ | 8 | 8 4 2 2 1 1 1 1 0 0 0 0 0 0 0 | ||
+ | 9 | 9 4 3 2 1 1 1 1 1 0 0 0 0 0 0 | ||
+ | A | A 5 3 2 2 1 1 1 1 1 0 0 0 0 0 | ||
+ | B | B 5 3 2 2 1 1 1 1 1 1 0 0 0 0 | ||
+ | C | C 6 4 3 2 2 1 1 1 1 1 1 0 0 0 | ||
+ | D | D 6 4 3 2 2 1 1 1 1 1 1 1 0 0 | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | ====Remainder==== | ||
+ | <cli> | ||
+ | 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 the base==== | ====Altering the base==== | ||
<cli> | <cli> | ||
Line 109: | Line 159: | ||
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. |