CIS 150 (C++ I) Demonstration Programs

  1. May24.cpp: 5/24/2005 in-class demo
  2. DemoDatatypes1.cpp: basic integer data types
  3. DemoDatatypes2.cpp: basic fp data types
  4. DemoIO.cpp: basic input and output
  5. DemoOperators.cpp: math operators with integer division
  6. DemoOperators2.cpp: math operators with fp division
  7. DemoPrecedence.cpp: operator precedence
  8. DemoFormattedIO1.cpp: basic output formatting
  9. DemoEscapes.cpp: escape sequences
  10. testmath.cpp: some basic math functions
  11. testio0.cpp: some basic cin functions
  12. testio1.cpp: more I/O formatting
  13. testio2.cpp: data validation using if/else
  14. testio3.cpp: data validation using switch
  15. InputExample.cpp: handling invalid input gracefully with validation
  16. testops1.cpp: combination arithmetic operators
  17. testops2.cpp: increment and decrement operators
  18. testsel1.cpp: "if" demonstration
  19. testsel2.cpp: "if/else" demonstration
  20. testsel3.cpp: "if/else" range checking
  21. testsel4.cpp: "switch" demonstration
  22. testsel5.cpp: "?:" demo, calculates maximum value
  23. teststr1.cpp: various string functions
  24. testRandom.cpp: generates random numbers
  25. testfile1.cpp: simple (but not quite working) file I/O
  26. testfile2.cpp: simple, working file I/O example
  27. testfile3.cpp: file I/O using repetition
  28. testrep1.cpp: for loop
  29. testrep2.cpp: while loop
  30. testrep3.cpp: do/while loop
  31. testrep4.cpp: addition accumulator
  32. testrep5.cpp: multiplication accumulator
  33. testrep6.cpp: break statement within a loop
  34. testrep7.cpp: continue statement
  35. testrep8.cpp: sentinel-controlled loop
  36. testrep9.cpp: example of a priming read
  37. testrep10.cpp: alternative to the priming read
  38. testrep11.cpp: an example of data validation using a loop
  39. testrep12.cpp: an example of a menu using a loop
  40. grav2.cpp: calculates the gravitational force of a hollow sphere on a particle within it using a manual integration process (posted by request)
  41. testfunc01.cpp: creating and calling a simple function
  42. testfunc02.cpp: demo of a function with an argument
  43. testfunc03.cpp: demo of a function with multiple arguments and a return value
  44. testfunc04.cpp: demonstration of a simple useful function
  45. testfunc05.cpp: function to roll a die
  46. testfunc06.cpp: function to roll two dice
  47. testfunc07.cpp: demonstration of variable scope
  48. testfunc08.cpp: static local variables
  49. testfunc09.cpp: overloading functions
  50. testfunc10.cpp: pause function and function overloading
  51. testfunc11.cpp: recursive and non-recursive factorial functions
  52. testfunc12.cpp: passing arguments to functions by reference
  53. testfunc13.cpp: using default arguments to funtions
  54. testfunc14.cpp: a useful data validation function for menus
  55. testfunc15.cpp: more complex function usage with reference variables
  56. testfunc16.cpp: recursive Towers of Hanoi solver
  57. testfunc17.cpp: recursive and non-recursive GCD functions
  58. testfmt01.cpp: printf formatting demonstration
  59. testarr01.cpp: declaring an array
  60. testarr02.cpp: initializing an array
  61. testarr03.cpp: auto-sizing an array
  62. testarr04.cpp: keeping track of a partially filled array
  63. testarr05.cpp: common array tasks
  64. testarr06.cpp: going out of bounds with an array
  65. testarr07.cpp: accumulate rolls of one die
  66. testarr08.cpp: accumulate rolls of two dice
  67. testarr09.cpp: passing arrays to functions
  68. testarr10.cpp: using an array of strings
  69. testarr11.cpp: using parallel arrays
  70. testarr12.cpp: displaying corresponding elements of parallel arrays
  71. testarr13.cpp: searching through one array to find info in another
  72. testarr14.cpp: parallel arrays loaded from a file
  73. testvector.cpp: demonstration of vector class
  74. testsearch1.cpp: linear search demonstration
  75. testsearch2.cpp: binary search demonstration
  76. testsearch3.cpp: linear/binary search comparison
  77. testsort.cpp: demonstration of various sorting algorithms
  78. testsort2.cpp: sorting parallel arrays
  79. testpointer1.cpp: simple pointer demo
  80. testpointer2.cpp: passing a pointer to a function
  81. testpointer3.cpp: using pointers with an array
  82. testpointer4.cpp: using pointers to work with strings
  83. testalloc1.cpp: simple memory allocation demonstration
  84. testalloc2.cpp: demonstration of array allocation
  85. testchar1.cpp: working with chars
  86. testchar2.cpp: creating simple char/string functions
  87. teststring1.cpp: some common C-style string functions
  88. teststring2.cpp: sorting C-style strings
  89. teststring3.cpp: converting C-style strings into numbers
  90. teststring4.cpp: C++ string class basics
  91. teststring5.cpp: using common C++ string class functions/methods
  92. teststruct1.cpp: struct basics
  93. teststruct2.cpp: arrays of structures
  94. teststruct3.cpp: sorting an array of structures
  95. dgkio.h: robust functions for a few common input tasks
  96. testdgkio.cpp: demonstrates usage of dgkio.h file
  97. asst01.cpp: solution to assignment #1
  98. asst02.cpp: solution to assignment #2
  99. asst03.cpp: solution to assignment #3
  100. asst04.cpp: solution to assignment #4
  101. asst04x.cpp: demo of solution to assignment #4 if user-defined functions did not exist
  102. asst05.cpp: solution to assignment #5
  103. asst06.cpp: solution to assignment #6
  104. lab04.cpp: solution to lab 4
  105. lab05.cpp: solution to lab 5
  106. lab06.cpp: solution to lab 6
  107. lab07.cpp: solution to lab 7
  108. lab08.cpp: solution to lab 8
  109. lab09.cpp: solution to lab 9
  110. lab10a.cpp: solution to lab 10 part I
  111. lab10b.cpp: solution to lab 10 part II
  112. lab11.cpp: solution to lab 11
  113. lab12.cpp: solution to lab 12

Return Links

Mr. Klick's Home Page