This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
haas:spring2014:cprog:projects [2014/02/25 10:41] – [Week 6] wedge | haas:spring2014:cprog:projects [2014/04/18 14:56] (current) – [Projects] wedge | ||
---|---|---|---|
Line 13: | Line 13: | ||
* [[/ | * [[/ | ||
* [[/ | * [[/ | ||
- | * [[/ | + | * [[/ |
+ | |||
+ | ======Week 10====== | ||
+ | |||
+ | * Questions | ||
+ | * structs | ||
+ | * structs in action | ||
+ | |||
+ | ======Week 9===== | ||
+ | * Question and answer week. Some good code examples too. | ||
+ | |||
+ | ======Week 8===== | ||
+ | * As I teach the lab, I wasn't able to give out warning grades. I sent a list to Joe, who promptly did not get to submitting warning grades. However... I was rather unsettled by what I saw: | ||
+ | * 16 total people in the class | ||
+ | * 7 are doing fine (~43%) | ||
+ | * most have only submitted 3 or 4 out of 6 projects | ||
+ | * most have been very attentive on their Opus | ||
+ | * most have attended most if not all classes | ||
+ | * 2 would be doing fine (~12%) if they would keep their Opus up-to-date (at least one entry per week) | ||
+ | * projects/ | ||
+ | * don't forget about the Opus! | ||
+ | * 7 are not doing fine (~43%) | ||
+ | * none to 2 out of 6 projects submitted | ||
+ | * attendance is all over the place (never through all) | ||
+ | * opus is all over the place (1 entry total through just over 1 entry per week) | ||
+ | * So, 2+7 = 9; 9/16 = 56%. | ||
+ | * more than half the class is not passing (this is new to me) | ||
+ | * I don't seem to be getting enough questions based on the lack of work I'm seeing | ||
+ | * I know some people aren't spending enough time on class material (how are you going to learn it if you don't play with it) | ||
+ | * 56% of the class would get an F in the class if grades were to be submitted now | ||
+ | * We seem to have gotten about a week behind on project completion. Well, for those who have been being active and attentive in class. | ||
+ | * I've made the next project due in 2 weeks instead of 1 to help you get caught up. | ||
+ | * Remember: | ||
+ | * I can answer questions from Joe's side of class | ||
+ | * Joe can answer questions from my side of class | ||
+ | * We have tutors, they can help | ||
+ | * I can answers questions from my side of class | ||
+ | * I can answer said questions outside of class | ||
+ | * I can answer said questions inside of/during class | ||
+ | * Asking questions is good | ||
+ | ======Week 7====== | ||
+ | |||
+ | * Be sure your Opus is up to date with your weekly progress and exploits! | ||
+ | * loops | ||
+ | * for | ||
+ | * while | ||
+ | * do while | ||
+ | * functions | ||
+ | * return type | ||
+ | * parameters | ||
+ | * function prototypes | ||
======Week 6====== | ======Week 6====== | ||
Line 22: | Line 72: | ||
* while | * while | ||
* do while | * do while | ||
+ | * Type in these programs, compile/ | ||
+ | * figure out what is going on with each and every step | ||
+ | * ask questions on things you do not understand | ||
+ | * Be sure to update your Opus! | ||
+ | |||
+ | =====Single Dimensional Array of Characters===== | ||
+ | Arrays are commonly used to simulate strings in C. | ||
+ | |||
+ | <code c 1> | ||
+ | /* | ||
+ | * This code should produce a warning on compilation. Fix it. | ||
+ | */ | ||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | int i; | ||
+ | char input[12]; | ||
+ | |||
+ | fprintf(stdout, | ||
+ | fgets(input, | ||
+ | |||
+ | fprintf(stdout, | ||
+ | |||
+ | for(i=0; i< | ||
+ | { | ||
+ | if (input[i] == ' | ||
+ | fprintf(stdout, | ||
+ | else if (*(input+i) == ' | ||
+ | fprintf(stdout, | ||
+ | else | ||
+ | fprintf(stdout, | ||
+ | } | ||
+ | return(0); | ||
+ | } | ||
+ | </ | ||
+ | =====Single Dimensional Array and Memory===== | ||
+ | To have a better understanding of arrays, we should note how they are represented in memory. Pay close attention to the output of this program: | ||
+ | |||
+ | <code c 1> | ||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | int i; | ||
+ | unsigned short int data[8] = { 255, 256, 49152, 13, 65535, 2600 }; | ||
+ | |||
+ | fprintf(stdout, | ||
+ | fprintf(stdout, | ||
+ | fscanf(stdin, | ||
+ | |||
+ | fprintf(stdout, | ||
+ | fscanf(stdin, | ||
+ | |||
+ | fprintf(stdout, | ||
+ | for(i = 0; i < 8; i++) | ||
+ | { | ||
+ | fprintf(stdout, | ||
+ | fprintf(stdout, | ||
+ | fprintf(stdout, | ||
+ | fprintf(stdout, | ||
+ | fprintf(stdout, | ||
+ | } | ||
+ | fprintf(stdout, | ||
+ | |||
+ | return(0); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | =====Command-line Arguments and 2D Array Manipulation===== | ||
+ | Here we play with a two-dimensional array created by the system, via the command-line arguments provided to main(): | ||
<code c 1> | <code c 1> |