This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2014:cprog:projects:multby11 [2014/01/17 07:49] – [Execution] wedge | haas:spring2014:cprog:projects:multby11 [2014/02/06 17:47] (current) – [Multiplying any single digit number by 11] wedge | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <WRAP centeralign round box> | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | ~~TOC~~ | ||
+ | |||
======Project: | ======Project: | ||
- | A project for C/C++ Programming. | ||
=====Objective===== | =====Objective===== | ||
To implement a programmatic solution (ie simulation) of a real life process- the mental math trick of multiplying any one-, two-, or three-digit number by eleven. | To implement a programmatic solution (ie simulation) of a real life process- the mental math trick of multiplying any one-, two-, or three-digit number by eleven. | ||
- | =====Prerequisites===== | + | =====Prerequisites/ |
In addition to the new skills required on previous projects, to successfully accomplish/ | In addition to the new skills required on previous projects, to successfully accomplish/ | ||
Line 25: | Line 31: | ||
In the case of 1 x 11, we get: 11 | In the case of 1 x 11, we get: 11 | ||
+ | |||
For 2 x 11, we see: 22 | For 2 x 11, we see: 22 | ||
+ | |||
For 3 x 11, we have: 33 | For 3 x 11, we have: 33 | ||
Line 170: | Line 178: | ||
=====Execution===== | =====Execution===== | ||
- | Two operating behaviors are shown, namely, with and without command-line arguments. | + | Several |
- | First up, without: | + | First up, three digit value without |
<cli> | <cli> | ||
Line 181: | Line 189: | ||
</ | </ | ||
- | Finally, with: | + | Second, a two digit value without argument: |
+ | |||
+ | < | ||
+ | lab46: | ||
+ | Enter value: 32 | ||
+ | 32 x 11 = 352 | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | Next, a one digit value with argument: | ||
+ | |||
+ | < | ||
+ | lab46: | ||
+ | 7 x 11 = 77 | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | Finally, | ||
<cli> | <cli> | ||
lab46: | lab46: | ||
Line 200: | Line 226: | ||
* Code must compile cleanly (no warnings or errors) | * Code must compile cleanly (no warnings or errors) | ||
- | * Executed program must display a total of 2 lines, one for input, one for output. | + | * Executed program must display a total of 1 or 2 lines (depending on presence of argument) |
* Output must be correct, and match the form given in the sample output above. | * Output must be correct, and match the form given in the sample output above. | ||
* Code must be nicely and consistently indented (you may use the **indent** tool) | * Code must be nicely and consistently indented (you may use the **indent** tool) | ||
+ | * Code must utilize the algorithm presented above | ||
* Code must be commented | * Code must be commented | ||
* have a properly filled-out comment banner at the top | * have a properly filled-out comment banner at the top | ||
Line 221: | Line 248: | ||
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. | ||
- | ====Verify submission==== | ||
- | To verify you submitted successfully, | ||
- | |||
- | <cli> | ||
- | lab46:~$ verify cprog multby11 | ||
- | multby11: submitted successfully | ||
- | </ | ||
- | Note if automated assessment is available for the project, you may actually see results in the output as well. |