This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2017:cprog:projects:sof0 [2017/01/24 15:21] – [Execution] wedge | haas:spring2017:cprog:projects:sof0 [2017/01/31 21:25] (current) – [Program] wedge | ||
---|---|---|---|
Line 15: | Line 15: | ||
The allure of using (and learning) a programming language is to be able to effectively use it to solve problems, which in and of themselves are simulations of some process we can do in "the real world" | The allure of using (and learning) a programming language is to be able to effectively use it to solve problems, which in and of themselves are simulations of some process we can do in "the real world" | ||
- | In this case, we will be writing a program which will implement the mental math techniques for computing the square of any two-digit number that ends with 5. | + | In this case, we will be writing a program which will implement the mental math techniques for computing the square of any one, two-, or three-digit number that ends with 5. |
=====Background===== | =====Background===== | ||
Line 118: | Line 118: | ||
* display the resulting number to STDOUT (right-justified in a space supporting the largest possible value -- see output example below) | * display the resulting number to STDOUT (right-justified in a space supporting the largest possible value -- see output example below) | ||
* display any supporting text to STDERR (display of source values left-justified in a space supporting 3-digit values -- see output example below). | * display any supporting text to STDERR (display of source values left-justified in a space supporting 3-digit values -- see output example below). | ||
+ | * because we have not officially learned how to do selection/ | ||
=====Execution===== | =====Execution===== | ||
Line 167: | Line 168: | ||
* We are using command-line I/O redirection to redirect STDOUT (which is bound to file descriptor #1) to the system bit-bucket. | * We are using command-line I/O redirection to redirect STDOUT (which is bound to file descriptor #1) to the system bit-bucket. | ||
+ | =====Verification===== | ||
+ | One of the tests I will perform for output compliance of your code will involve comparing your program' | ||
+ | |||
+ | I will make use of a checksum to verify exactness. | ||
+ | |||
+ | You will need to run this from your sof0 project directory with a compiled and operational binary by the name of **sof0**. | ||
+ | |||
+ | You can check your project by typing in the following at the prompt: | ||
+ | |||
+ | <cli> | ||
+ | lab46: | ||
+ | </ | ||
+ | |||
+ | If all aligns, you will see this: | ||
+ | |||
+ | <cli> | ||
+ | ================================================== | ||
+ | = CPROG sof0 project output validation tool = | ||
+ | ================================================== | ||
+ | sof0 checksum is: 822a47fb2a45845500b6c10878045bd5 | ||
+ | your checksum is: 822a47fb2a45845500b6c10878045bd5 | ||
+ | ================================================== | ||
+ | verification: | ||
+ | ================================================== | ||
+ | </ | ||
+ | |||
+ | If something is off, your checksum will not match the sof0 checksum, and verification will instead say " | ||
+ | |||
+ | <cli> | ||
+ | ================================================== | ||
+ | = CPROG sof0 project output validation tool = | ||
+ | ================================================== | ||
+ | sof0 checksum is: 822a47fb2a45845500b6c10878045bd5 | ||
+ | your checksum is: 92af264c86823a61529948caaeac53e0 | ||
+ | ================================================== | ||
+ | verification: | ||
+ | ================================================== | ||
+ | </ | ||
=====Questions / Food for Thought===== | =====Questions / Food for Thought===== | ||
These are things I'd like you to contemplate, | These are things I'd like you to contemplate, |