======Part 3====== =====Entries===== ====Entry 9: 4/3/2012==== we have been doing some multi- file program examples in class. Doing multi file programs keep your code more organized. It takes longer and uses more over head to use muli-file programs. * multi-file program * more organized code ====Entry 10: 4/5/2012=== In class we have been learning about multi-file programs, and in order to do that you need to create .o files. I learned you have to make a .h file w/ a corresponding .cc file, in order to get a .o file. then include that header file in your program using "" instead of <> * .o files * need them for making multi-file programs ====Entry 11: 4/24/12==== Today in C/C++ class we learned a little more about classes. We talked about the "friends" class. I learned that kids cannot access their parents private parts, but friends can access their parents private parts. * friends classes * friends can have access to the private things in the parent class ====Entry 12: 4/26/12==== today in C/C++ class Matt reviewed a little bit about forms. Forms cannot be used for every thing, but if you are in a situation where a form could be used it will save a lot of time, and code. * forms * can save you a lot of time and hassle {{page>cprogpart3&nofooter}} =====Experiments===== ====Experiment 7==== ===Question=== What happens if i leave the semi colon off of the end of a printf statement ===Resources=== C pocket reference ===Hypothesis=== Based on what i have been reading in the C pocket reference, if i leave a needed semi colon off of a printf statement it will give me a syntax error and not compile. ===Experiment=== I am going to take the semi colon off of the Hello, world! program's printf. ===Data=== When i took the semi colon off of the Hello, World! program and tried to compile it, the following error occurred: hello.c: In function 'main': hello.c:4: error: expected ';' before 'return' ===Analysis=== Based on the data collected: * Was your hypothesis correct? Yes my Hypothesis was correct ===Conclusions=== I can conclude that if you have even one syntax error it will not compile your code, but it is very helpful by telling you where it is ( even down to telling you what line in the code it is on) ====Experiment 8==== ===Question=== What will a simple for loop do if i change i++ to i--? ===Resources=== C programming text book ===Hypothesis=== Based on what i have read in the C book i++ increments by 1 every time it loops, my hypothesis is that i-- will decrement by 1 every time it loops. ===Experiment=== #include int main() { int i; for (i = 0; i < 10; i--) { printf ("i=%d\n",i); } return 0; } ===Data=== When i ran this program with i-- in the for loop, it did decrement by 1 but it continuously looped, and i had to exit the terminal. ===Analysis=== Based on the data collected: * Was your hypothesis correct? Sort of, it did decrement. * What shortcomings might there be in your experiment? yes, i did not change the counter sign in the for loop to account for decrementing. ===Conclusions=== I have concluded that you can increment and decrement in a for loop, just make sure you change the counter statement. ====Retest 3==== Perform the following steps: ===State Experiment=== Whose existing experiment are you going to retest? Provide the URL, note the author, and restate their question. ===Resources=== Evaluate their resources and commentary. Answer the following questions: * Do you feel the given resources are adequate in providing sufficient background information? * Are there additional resources you've found that you can add to the resources list? * Does the original experimenter appear to have obtained a necessary fundamental understanding of the concepts leading up to their stated experiment? * If you find a deviation in opinion, state why you think this might exist. ===Hypothesis=== State their experiment's hypothesis. Answer the following questions: * Do you feel their hypothesis is adequate in capturing the essence of what they're trying to discover? * What improvements could you make to their hypothesis, if any? ===Experiment=== Follow the steps given to recreate the original experiment. Answer the following questions: * Are the instructions correct in successfully achieving the results? * Is there room for improvement in the experiment instructions/description? What suggestions would you make? * Would you make any alterations to the structure of the experiment to yield better results? What, and why? ===Data=== Publish the data you have gained from your performing of the experiment here. ===Analysis=== Answer the following: * Does the data seem in-line with the published data from the original author? * Can you explain any deviations? * How about any sources of error? * Is the stated hypothesis adequate? ===Conclusions=== Answer the following: * What conclusions can you make based on performing the experiment? * Do you feel the experiment was adequate in obtaining a further understanding of a concept? * Does the original author appear to have gotten some value out of performing the experiment? * Any suggestions or observations that could improve this particular process (in general, or specifically you, or specifically for the original author).