This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:fall2019:c4eng:projects:mtf0 [2019/09/16 13:09] – created wedge | haas:fall2019:c4eng:projects:mtf0 [2019/09/30 11:57] (current) – [Submission] wedge | ||
---|---|---|---|
Line 26: | Line 26: | ||
Your program should: | Your program should: | ||
+ | * have valid, descriptive variable names of length //no shorter than// 4 symbols | ||
+ | * I will make an exception for the use of ' | ||
* prompt the user for the operation (' | * prompt the user for the operation (' | ||
- | + | * properly store this in a variable of type (signed) **char** | |
- | * perform the task (process) | + | * check for a literal ' |
- | * display | + | * if invalid input, display an error and exit with a non-zero value |
+ | * prompt for the row (0-9) | ||
+ | * properly store this in a variable of type **unsigned short int** | ||
+ | * prompt for the starting column | ||
+ | * properly store this in a variable of type **unsigned short int** | ||
+ | * prompt for the ending column (0-9) | ||
+ | * properly store this in a variable of type **unsigned short int** | ||
+ | * check to make sure starting column is less than or equal to ending column | ||
+ | * if not, display an error (to STDERR) and exit with non-zero status code | ||
+ | * display the row of the table, performing the indicated operation | ||
+ | * display each numerical value in organized, consistent fashion, assuming two-digit numbers | ||
+ | * using a single return statement at the conclusion of the code, return a 0 indicating successful operation | ||
=====Execution===== | =====Execution===== | ||
+ | ====Sample run using multiplication==== | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Which year: 2014 | + | Which operation (' |
- | January 1st, 2014 falls on: Wednesday | + | Row (0-9): 4 |
- | lab46: | + | Starting Column (0-9): 1 |
+ | Ending Column (0-9): 5 | ||
+ | | ||
+ | lab46: | ||
</ | </ | ||
The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate. | The execution of the program is short and simple- obtain the input, do the processing, produce the output, and then terminate. | ||
- | ====Output Specifications==== | + | ====Sample run using addition==== |
- | Your program must output as follows: | + | < |
+ | lab46:~/ | ||
+ | Which operation (' | ||
+ | Row (0-9): 5 | ||
+ | Starting Column (0-9): 2 | ||
+ | Ending Column (0-9): 7 | ||
+ | | ||
+ | lab46: | ||
+ | </ | ||
- | * Input prompts, and everything else except the actual day of the week should be output to STDERR | + | ====Sample run with invalid operation given==== |
- | * The calculated day of the week needs to be displayed to STDOUT | + | < |
- | * The output MUST contain the " | + | lab46: |
- | * YEAR must be all 4 digits, exactly as input by the user | + | Which operation (' |
- | * The calculated day of the week must be fully spelled out and correct, with the first letter capitalized, | + | ERROR: Must specify either ' |
- | =====Reflection===== | + | lab46: |
- | Be sure to provide any commentary on your journal regarding realizations had and discoveries made during your pursuit of this project. | + | </ |
- | * Try this algorithm on some years in the 20th century and see how it fares. | + | ====Sample run with invalid column configuration==== |
- | * Is it correct? Is it correct for any of them? | + | < |
- | * If it isn't correct, | + | lab46: |
+ | Which operation (' | ||
+ | Row (0-9): 5 | ||
+ | Starting Column (0-9): 7 | ||
+ | Ending Column (0-9): 2 | ||
+ | ERROR: Starting column | ||
+ | lab46: | ||
+ | </ | ||
- | This isn't just about implementing a particular algorithm, it is about understanding an algorithm- its domain of correctness, | ||
=====Submission===== | =====Submission===== | ||
Line 63: | Line 94: | ||
* 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. | ||
* 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 | + | * Code must be nicely and consistently indented |
- | * Code must be commented | + | * Code must be well commented |
+ | * Do NOT double space your code. Group like statements together. | ||
* Output Formatting (including spacing) of program must conform to the provided output (see above). | * Output Formatting (including spacing) of program must conform to the provided output (see above). | ||
* Track/ | * Track/ | ||
Line 87: | Line 118: | ||
< | < | ||
78: | 78: | ||
- | *:mtf0:data stored | + | *:mtf0:proper error checking |
- | *:mtf0:code is pushed to lab46 repository [4/4] | + | *:mtf0:correct variable types and name lengths used [13/13] |
- | *: | + | *:mtf0:proper |
- | *: | + | *: |
- | *: | + | *:mtf0:no negative compiler messages for program [13/13] |
- | *: | + | *:mtf0:code is pushed to lab46 repository |
- | *:mtf0:no negative compiler messages for dow0.c | + | |
</ | </ | ||
Line 100: | Line 130: | ||
* Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction | * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction | ||
* Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | ||
- | * Solutions not organized and easy to read (assume a terminal at least 90 characters wide, 40 characters tall) are subject to a 25% overall deduction | + | * Solutions not organized and easy to read are subject to a 25% overall deduction |