CIS 150 (C++ I) Demonstration Programs
- May24.cpp: 5/24/2005 in-class demo
- DemoDatatypes1.cpp: basic integer data types
- DemoDatatypes2.cpp: basic fp data types
- DemoIO.cpp: basic input and output
- DemoOperators.cpp: math operators with integer division
- DemoOperators2.cpp: math operators with fp division
- DemoPrecedence.cpp: operator precedence
- DemoFormattedIO1.cpp: basic output formatting
- DemoEscapes.cpp: escape sequences
- testmath.cpp: some basic math functions
- testio0.cpp: some basic cin functions
- testio1.cpp: more I/O formatting
- testio2.cpp: data validation using if/else
- testio3.cpp: data validation using switch
- InputExample.cpp: handling invalid input gracefully with validation
- testops1.cpp: combination arithmetic operators
- testops2.cpp: increment and decrement operators
- testsel1.cpp: "if" demonstration
- testsel2.cpp: "if/else" demonstration
- testsel3.cpp: "if/else" range checking
- testsel4.cpp: "switch" demonstration
- testsel5.cpp: "?:" demo, calculates maximum value
- teststr1.cpp: various string functions
- testRandom.cpp: generates random numbers
- testfile1.cpp: simple (but not quite working) file I/O
- testfile2.cpp: simple, working file I/O example
- testfile3.cpp: file I/O using repetition
- testrep1.cpp: for loop
- testrep2.cpp: while loop
- testrep3.cpp: do/while loop
- testrep4.cpp: addition accumulator
- testrep5.cpp: multiplication accumulator
- testrep6.cpp: break statement within a loop
- testrep7.cpp: continue statement
- testrep8.cpp: sentinel-controlled loop
- testrep9.cpp: example of a priming read
- testrep10.cpp: alternative to the priming read
- testrep11.cpp: an example of data validation using a loop
- testrep12.cpp: an example of a menu using a loop
- grav2.cpp: calculates the gravitational force of a hollow sphere on
a particle within it using a manual integration process (posted by request)
- testfunc01.cpp: creating and calling a simple function
- testfunc02.cpp: demo of a function with an argument
- testfunc03.cpp: demo of a function with multiple arguments and a return value
- testfunc04.cpp: demonstration of a simple useful function
- testfunc05.cpp: function to roll a die
- testfunc06.cpp: function to roll two dice
- testfunc07.cpp: demonstration of variable scope
- testfunc08.cpp: static local variables
- testfunc09.cpp: overloading functions
- testfunc10.cpp: pause function and function overloading
- testfunc11.cpp: recursive and non-recursive factorial functions
- testfunc12.cpp: passing arguments to functions by reference
- testfunc13.cpp: using default arguments to funtions
- testfunc14.cpp: a useful data validation function for menus
- testfunc15.cpp: more complex function usage with reference variables
- testfunc16.cpp: recursive Towers of Hanoi solver
- testfunc17.cpp: recursive and non-recursive GCD functions
- testfmt01.cpp: printf formatting demonstration
- testarr01.cpp: declaring an array
- testarr02.cpp: initializing an array
- testarr03.cpp: auto-sizing an array
- testarr04.cpp: keeping track of a partially filled array
- testarr05.cpp: common array tasks
- testarr06.cpp: going out of bounds with an array
- testarr07.cpp: accumulate rolls of one die
- testarr08.cpp: accumulate rolls of two dice
- testarr09.cpp: passing arrays to functions
- testarr10.cpp: using an array of strings
- testarr11.cpp: using parallel arrays
- testarr12.cpp: displaying corresponding elements of parallel arrays
- testarr13.cpp: searching through one array to find info in another
- testarr14.cpp: parallel arrays loaded from a file
- testvector.cpp: demonstration of vector class
- testsearch1.cpp: linear search demonstration
- testsearch2.cpp: binary search demonstration
- testsearch3.cpp: linear/binary search comparison
- testsort.cpp: demonstration of various sorting algorithms
- testsort2.cpp: sorting parallel arrays
- testpointer1.cpp: simple pointer demo
- testpointer2.cpp: passing a pointer to a function
- testpointer3.cpp: using pointers with an array
- testpointer4.cpp: using pointers to work with strings
- testalloc1.cpp: simple memory allocation demonstration
- testalloc2.cpp: demonstration of array allocation
- testchar1.cpp: working with chars
- testchar2.cpp: creating simple char/string functions
- teststring1.cpp: some common C-style string functions
- teststring2.cpp: sorting C-style strings
- teststring3.cpp: converting C-style strings into numbers
- teststring4.cpp: C++ string class basics
- teststring5.cpp: using common C++ string class functions/methods
- teststruct1.cpp: struct basics
- teststruct2.cpp: arrays of structures
- teststruct3.cpp: sorting an array of structures
- dgkio.h: robust functions for a few common input tasks
- testdgkio.cpp: demonstrates usage of
dgkio.h file
- asst01.cpp: solution to assignment #1
- asst02.cpp: solution to assignment #2
- asst03.cpp: solution to assignment #3
- asst04.cpp: solution to assignment #4
- asst04x.cpp: demo of solution to assignment #4 if user-defined functions did not exist
- asst05.cpp: solution to assignment #5
- asst06.cpp: solution to assignment #6
- lab04.cpp: solution to lab 4
- lab05.cpp: solution to lab 5
- lab06.cpp: solution to lab 6
- lab07.cpp: solution to lab 7
- lab08.cpp: solution to lab 8
- lab09.cpp: solution to lab 9
- lab10a.cpp: solution to lab 10 part I
- lab10b.cpp: solution to lab 10 part II
- lab11.cpp: solution to lab 11
- lab12.cpp: solution to lab 12
Return Links
Mr. Klick's Home Page