This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
haas:fall2022:cprog:projects:dtr0 [2020/01/26 22:46] – external edit 127.0.0.1 | haas:fall2022:cprog:projects:dtr0 [2022/08/28 21:37] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
</ | </ | ||
- | ======Project: DATA TYPE RANGES | + | ======PROJECT: Data Type Resources |
- | =====Objective===== | + | =====OBJECTIVE===== |
- | To familiarize yourself | + | To begin our exploration of programming, |
- | =====Prerequisites===== | + | =====GRABIT===== |
- | In order to successfully accomplish/ | + | To assist with consistency across all implementations, |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * ability to read and appropriately react to compiler messages during compilation | + | |
- | * ability to execute compiled code | + | |
- | * knowledge of the size of a byte, how many bit combinations are possible therein | + | |
- | * ability to use version control system to track created source file(s) | + | |
- | + | ||
- | =====Scope===== | + | |
- | This project will be exploring the nature of some of the data types available to us in the C Programming Language. How much space is allocated | + | |
- | + | ||
- | A program is provided | + | |
- | + | ||
- | The data types covered for this project will include **signed** and **unsigned** variations of: | + | |
- | + | ||
- | * char | + | |
- | * short int | + | |
- | * int | + | |
- | * long int | + | |
- | * long long int | + | |
- | + | ||
- | The **sizeof()** and **printf()** functions, as well as arithmetic and logical operators, will be utilized in performing much of the work. | + | |
- | + | ||
- | =====Grabbing project resources===== | + | |
- | I have prepared a **grabit** for resources related to this project. To obtain: | + | |
<cli> | <cli> | ||
- | lab46:~/src/cprog$ grabit cprog dtr0 | + | lab46: |
- | make: Entering directory '/ | + | |
- | '/ | + | |
- | '/ | + | |
- | make: Leaving directory '/ | + | |
- | lab46: | + | |
</ | </ | ||
- | At which point you can change into the newly created and populated **dtr0** directory. | + | =====EDIT===== |
+ | You will want to go [[/ | ||
- | Please study the **dtr0.c** program, and look up or ask questions on aspects that you do not understand. | + | |
- | Compile it. | + | {{page> |
- | =====Execution===== | + | |
- | <cli> | + | =====SUBMISSION===== |
- | lab46:~/ | + | To be successful in this project, the following criteria (or their equivalent) must be met: |
- | </ | + | |
- | =====Reflection===== | + | |
- | Be sure to provide any commentary on your journal regarding realizations had and discoveries made during your pursuit of this project. You should also consider adding extra comments into your program so that it can be a more valuable reference going forward. | + | * Late submissions will lose 33% credit per day, with the submission window closing on the 3rd day following the deadline. |
- | + | ||
- | =====Your task===== | + | |
- | You are to create a text file, called " | + | |
- | + | ||
- | * What two data types appeared "the same"? | + | |
- | * Why is this the case? | + | |
- | * With respect to **printf()**: | + | |
- | * What is the difference between **printf()** and **fprintf()**? | + | |
- | * What is **stdout**? Where is it by default? | + | |
- | * What is the difference between **%s**, **%hhu**, **%hu**? | + | |
- | * How about **%u** and **%d**? | + | |
- | * What does the **22** in **%22s** do for us? | + | |
- | * If sign was left unspecified, | + | |
- | * What are the **< | + | |
- | * What are they doing to enable the display of the output? | + | |
- | * Based on your program' | + | |
- | * signed char | + | |
- | * unsigned short int | + | |
- | * unsigned int | + | |
- | * signed int | + | |
- | * signed long long int | + | |
- | + | ||
- | =====Review of Compiling/ | + | |
- | Just to review the compilation/ | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | Assuming there are no syntax errors or warnings, and everything compiled correctly, you should just get your prompt back. In the event of problems, the compiler will be sure to tell you about them. | + | |
- | + | ||
- | Conceptually, | + | |
- | + | ||
- | < | + | |
- | gcc -Wall --std=gnu99 -o BINARY_FILE SOURCE_FILE | + | |
- | </ | + | |
- | + | ||
- | The BINARY_FILE comes **immediately after** the **-o**, **NOT** the SOURCE_FILE (it must never **immediately** follow a **-o**). It can precede, and such is perfectly valid (especially if you feel that way more intuitive). | + | |
- | + | ||
- | The **-Wall** (treat all warnings as errors, increase general verbosity about warnings) and **--std=gnu99** (switch compiler to use the **C99** standard of the C language with GNU compiler extensions) are options given to the compiler. | + | |
- | + | ||
- | To execute your binary, we need to specify a path to it, so we use **./**, which references the current directory (the dot ' | + | |
- | + | ||
- | < | + | |
- | lab46: | + | |
- | Hello, World! | + | |
- | lab46: | + | |
- | </ | + | |
- | + | ||
- | =====Submission Criteria===== | + | |
- | To be successful in this project, the following criteria must be met: | + | |
- | + | ||
- | | + | |
- | * Late submissions will lose 25% credit per day, with the submission window closing on the 4th day following the deadline. | + | |
- | * Early submissions can earn 1 bonus point per day in advance of the posted due date. | + | |
* All code must compile cleanly (no warnings or errors) | * All code must compile cleanly (no warnings or errors) | ||
- | * Use the **-Wall** and **--std=gnu99** flags when compiling. | + | * Compile with the **-Wall** and **--std=gnu18** compiler |
- | * all requested functions must be implemented in the related library or program | + | * all requested functionality |
- | * all requested functionality must conform to stated requirements (either on this project page or in comment banner in source code files themselves). | + | |
* Executed programs must display in a manner similar to provided output | * Executed programs must display in a manner similar to provided output | ||
- | * output formatted, where applicable, must match that of project requirements | + | * output |
* Processing must be correct based on input given and output requested | * Processing must be correct based on input given and output requested | ||
* Output, if applicable, must be correct based on values input | * Output, if applicable, must be correct based on values input | ||
- | * Code must be nicely and consistently indented | + | * Code must be nicely and consistently indented |
+ | | ||
* Code must be commented | * Code must be commented | ||
* Any "to be implemented" | * Any "to be implemented" | ||
- | * these "to be implemented" | + | * these |
- | * Sufficient comments explaining the point of provided logic **MUST** be present | + | * Sufficient |
- | * Track/ | + | * No global variables (without instructor approval), no goto statements, no calling of main()! |
- | * Submit a copy of your source code to me using the **submit** tool by the deadline. | + | * Track/ |
- | | + | * Submit |
- | * Make sure it outputs exactly like the sample output above. | + | |
====Submit Tool Usage==== | ====Submit Tool Usage==== | ||
- | Let's say you have completed work on the project, and are ready to submit, you would do the following: | + | Let' |
+ | submit, you would do the following | ||
+ | uom0.c): | ||
<cli> | <cli> | ||
- | lab46: | + | lab46: |
- | Submitting cprog project " | + | |
- | -> dtr0.text(OK) | + | |
- | + | ||
- | SUCCESSFULLY SUBMITTED | + | |
- | lab46: | + | |
</ | </ | ||
- | 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. | ||
+ | =====RUBRIC===== | ||
I'll be evaluating the project based on the following criteria: | I'll be evaluating the project based on the following criteria: | ||
< | < | ||
- | 13:dtr0:final tally of results (13/13) | + | 39:dtr0:final tally of results (39/39) |
- | *:dtr0:submitted file called dtr0.text | + | *:dtr0:used grabit to obtain project by the Sunday prior to duedate |
- | *:dtr0:committed and pushed | + | *:dtr0:clean compile, no compiler messages [7/7] |
- | *:dtr0:sufficient info in dtr0.text | + | *:dtr0:program conforms |
+ | *:dtr0:code tracked | ||
</ | </ | ||
- | Additionally: | + | ===Pertaining to the collaborative authoring of project documentation=== |
- | * Solutions not abiding by spirit of project will be subject to a 25% overall deduction | + | |
- | * Solutions not utilizing descriptive why and how comments will be subject to a 25% overall deduction | + | * each class member is to participate in the contribution of relevant information and formatting of the documentation |
- | * Solutions not utilizing indentation to promote scope and clarity will be subject to a 25% overall deduction | + | * minimal member contributions consist of: |
- | * 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 | + | * near the class average edits (a value of at least four productive edits) |
+ | * near the average class content change average (a value of at least 256 bytes (absolute value of data content change)) | ||
+ | * near the class content contribution average (a value of at least 1kiB) | ||
+ | * no adding in one commit then later removing in its entirety for the sake of satisfying edit requirements | ||
+ | * adding and formatting data in an organized fashion, aiming to create an informative and readable document that anyone in the class can reference | ||
+ | * content contributions will be factored into a documentation coefficient, | ||
+ | * no contributions, | ||
+ | * less than minimum contributions is 0.75 | ||
+ | * met minimum contribution threshold is 1.00 | ||
+ | |||
+ | ===Additionally=== | ||
+ | |||
+ | * Solutions not abiding | ||
+ | * Solutions | ||
+ | * Solutions not utilizing indentation to promote scope and clarity | ||
+ | * 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 |