CMPSC 101 Ch.  Resources
CMPSC 101 Home

Demo Program #1 - to illustrate how C++ treats arithmetic and Boolean expressions. The program also illustrates the use of a couple relational and logical operators.

Demo Program #2 - the use of common logical and relational operators

Demo Program #3 - the use of the if statement

Demo Program #4 - to illustrate common errors related to the use of the if statement

Demo Program #5 - the use of the switch statement

Demo Program #6 - the use of a for loop

Demo Program #7 - the use of the while and do while loops

Demo Program #8 - the use of determinate, indeterminate, and nested loop

Demo Program #9 - the use of a flag variable

Demo Program #10 - tracing a simple loop