This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2014:cprog:projects:vertcross [2014/03/13 09:25] – [Program] wedge | haas:spring2014:cprog:projects:vertcross [2014/03/13 09:42] (current) – [Multiplying two double digit numbers together] wedge | ||
---|---|---|---|
Line 77: | Line 77: | ||
4 1 1 | 4 1 1 | ||
2 0 | 2 0 | ||
+ | | ||
+ | 4+2 1 1 | ||
+ | | ||
+ | 6 1 1 | ||
| | ||
= 611 | = 611 | ||
Line 87: | Line 91: | ||
In this case we merely extend the pattern of vertically and crosswise, namely: | In this case we merely extend the pattern of vertically and crosswise, namely: | ||
- | * there are 3 columns | + | * multiply right-most column vertically (ones place) |
- | * there are 2 crosswise | + | * multiply crosswise the two right-most |
+ | * multiply | ||
+ | * multiply | ||
+ | * multiply vertically the left-most column (ten thousands) | ||
+ | |||
+ | Note the stretching/ | ||
Let's look at 123 x 234: | Let's look at 123 x 234: | ||
Line 95: | Line 104: | ||
123 | 123 | ||
x 234 | x 234 | ||
- | | + | |
- | | + | |
- | | + | 2x4 + 3x3 + 1 tens place |
- | (1x4)+(2x3) an outer-most crosswise operation | + | |
- | --------------------------------- | + | |
- | 02 | + | |
- | | + | |
- | 4+6 | + | |
- | | + | in their position in the final number (ones place is furthest on the right). |
- | | + | |
- | 0717 | + | 123 x 234 = 28782 |
- | 10 | + | |
- | ------ | + | |
- | 028782 | + | |
</ | </ | ||
A dual benefit of this project is that in addition to extending your programming experience / understanding of C, you could develop this as a mental ability (that is where it originated), | A dual benefit of this project is that in addition to extending your programming experience / understanding of C, you could develop this as a mental ability (that is where it originated), | ||
- | |||
====Another depiction==== | ====Another depiction==== | ||
Here is another, more illustrative, | Here is another, more illustrative, | ||
Line 144: | Line 149: | ||
=====Execution===== | =====Execution===== | ||
- | Several operating behaviors are shown, namely, with and without command-line arguments and 1-, 2-, and 3-digit values. | + | Several operating behaviors are shown, namely, with and without command-line arguments and 2-, and 3-digit values. |
First up, two-digit values without argument: | First up, two-digit values without argument: | ||
Line 165: | Line 170: | ||
</ | </ | ||
- | =====Reflection===== | ||
- | Be sure to provide any commentary on your opus regarding realizations had and discoveries made during your pursuit of this project. | ||
- | |||
- | * Can this process be extended for four digit numbers? | ||
- | * How about five digit numbers? | ||
=====Submission===== | =====Submission===== |