Course Web Pages
Related LinksFree eBooks
|
Flow controlThe videos below demonstrate the use of flow control in a C++ program with examples from Dawson's Beginning C++ book. if statements if-else statements switch statements while do while Boolean (logical) operators Random Numbers Game Loop, Flow Diagram Guess My Number Naming ConventionsDifferent organizations have their own conventions for variable names. See, for example, the Variable Names entry in Google's Style Guide for C++. The important thing is to use meaningful names, be consistent, and pay attention to conventions used by the wider programming community. ExerciseFrom Beginning C++ Through Game Programming: Write a new version of the Guess My Number program in which the player and the computer switch roles. That is, the player picks a number and the computer must guess what it is. |