In Class Example Programs

Tuesday, December 11
HW6 Hints

Thursday, December 6
Structures

Thursday, November 29
Strings (various examples of using character arrays)
0 is FALSE (program that shows the integer value 0 is considered to be a FALSE value and non-zero integers are TRUE values)

Thursday, November 8
Random Number Generator (generates random numbers between 1 and 6 to simulate the rolling of a single die 100 times)
Print a Box Program (use of a programmer-defined function to print a box)

Tuesday, November 6
Square of an Integer Program (use of a programmer-defined function to return the square of an integer)

Thursday, November 1
ASCII Codes and Characters (also shows the use of the getchar and fflush functions)

Thursday, October 18
Preincrement, Postincrement and Arithmetic Operators

Tuesday, October 10
Use of if/else and switch Selection Structures (also uses the #define preprocessor directive to define symbolic constants)

Thursday, October 4
Sentinel-Controlled While Loop (example from page 72 in textbook)
Counter-Controlled While Loop (example from page 68 in textbook)
Switch Statement based on the Value of an Integer (Odd/Even Program)

Tuesday, October 2
Dangling Else Problem (make sure you match the else clause with the appropriate if statement)
Intro to Floating Point Data Type (examples of using the float unary cast operator and advanced use of the format specifier within printf)

Thursday, September 27
if Selection Structure with a Compound Statement
if Selection Structure Nested within an if Statement
if/else Selection Structure with Compound Statements
Coins Program (if/else Selection Structure with Compound Statements)
High-Low Program (reads in 5 grades using 1 scanf statement and determines the highest and lowest grade using if Selection Structures)

Tuesday, September 25
Average Grade Program (reads in 3 grades using 3 scanf statements and calculates the average)
Even Odd Program (reads in 2 integers using 2 scanf statements and uses if Selection Structures to compare their values)
Even Odd Program #2 (same as above, except only 1 scanf statement is used to read in 2 integers)
HW0 (Lab Assignment) (reads in 2 integers and displays the results of 5 arithmetic operators)