Dr. Seppi's Fall 2016 Examples
These may not run as is, some are used just to make an isolated point in my discussion. In some cases they may contain purposefully bad examples, as discussed in class. Since I edit examples in class, so these may not contain everything you saw in class.
Chapter 1
Hello - This is a very basic example of a c++ program
-
-
Chapter 2
Types and assignment - These are just isolated lines of code demonstrating the use of variables, ints and doubles
-
Bulb - Compute power cost using floats
-
Chapter 3
Chapter 4
Guessing Numbers - Computer picks a number and the user has to guess what it is.
-
-
-
-
Chapters 5 and 6
-
-
-
-
Scope - A bad example of scope
-
-
-
-
-
-
-
-
-
-
Chapter 7
Chapter 8
-
Cars - a very simple, perhaps even stupid class example
-
Chapter 9
Chapter 10
-
Books - An example invloving library books
Other useful things
Sort - The sort example from the book
-
Static - Using static for a serial number on a class
For later:
Grades - a grade conversion example with interesting input checking
-
Old Examples
Back to top