| CMPSC 101 Demos | |
|
The following demo programs will be reviewed in each class. ***************** Unit: Variables ***************** Class #1 Class #2 cout statements - displaying output with cout, endl, and \n using variables - using variables, cin, declaration & assignment statements, comments tic tac toe display board - using several cout statements to display a tic tac toe board tic tac toe with variables - using 9 variables to represent positions of board Class #3 special operators - modulus operator %, incrementing operator ++, compound operator += overflow integer division - illustrating nasty concepts of integer division, type casting, overflow, & underflow macho rounding - a method of rounding that uses type casting setf rounding - a method of rounding that uses cout.setf & cout.setprecision ***************** Unit: If Statements ***************** Class #4 if statement - using an if statement to control a menu nested if statements - using an if statement to control a menu & validating user input tic tac toe board with if statement - using if statements to check for win in tic tac toe ***************** Unit: Loops ***************** Class #5 while loop 1 - running total while loop 2 - running total with sentinel value to exit loop while loop 3 - running total with sentinel value & flag variable to exit loop while loop 4 - menu, running total with sentinel value & flag variable ***************** Unit: Functions ***************** Class #6 lots of easy functions - various functions void function - example of a function that doesn't return a value Class #8 round function - rounding, compute tax, & a void functions random numbers - using the rand library function. moving on a grid - using a function that moves a player around a grid ***************** Unit: Files ***************** Class #9 reading from file - reading numbers from a sequential access file reading and writing files - use of a while loop with eof function appending to a file - appending data to the end of a file when writing data to it ***************** Unit: Arrays ***************** Class #10 Class #12 sequential search finding max value - tic tac toe - using a one-dimensional array to represent a tic tac toe board ***************** Unit: Strings ***************** Class #13 ***************** Unit: Miscellaneous ***************** Miscellaneous The following programs are relevant and appropriate for study in CMPSC 101:
|
|