Week 8

Moreover, this week we started to talk about classes (using, understanding, design, implement, update). The material is from Chapters 5, 6 and 7. Some parts of those chapters are directly related to classes. Section numbers are given in the classes2.ppt file. Some examples are not in the book but all codes covered in lectures are given below. Moreover this ppt file contains some details about robot class implementation. We have not finished everything, we will continue next week.

The modified robot class and minifw files will be distributed in recitation8 materials and hw5 zip file.

Powerpoint file

classes2.ppt
 

C++ codes discussed in class (some of them might have been modified in class to show extra features)

usedate.cpp
datedemo.cpp
fathersday.cpp
These examples use the Date class. The header and implementation files of the Date class are below. You have to have both files in the same folder as the program file and add date.cpp to the project as a source file.
date.h
date.cpp
 

roll.cpp
testdice.cpp
These examples use the Dice class. The header and implementation files of the Dice class are below. You have to have both files in the same folder as the program file and add dice.cpp to the project as a source file.
Moreover, the Dice class utilizes the RandGen class. The header and implementation files of the RandGen class are also provided below. Similarly, you have to have both files in the same folder as the program file and add randgen.cpp to the project as a source file.
dice.h
dice.cpp
randgen.cpp
randgen.h
 

demodatemodified is an example for class modification. The modified Date class header an implementation files are also given below.
date_modified.h
date_modified.cpp
demodatemodified.cpp

numberguess example uses RandGen class (randgen.cpp and randgen.h files are needed as in Dice examples).
numberguess.cpp

The followings are the files related to the Question class the we developed from scratch using iterative enhancement approach. simplemathquest.h and simplemathquest.cpp files are the class definition and implementation files and needs to be stored in the same folder as simplequiz.cpp. simplemathquest.cpp file must also be added to the project as a source file.
simplemathquest.h
simplemathquest.cpp
simplequiz.cpp

prompt.h and prompt.cpp (this prompt utility is used in simple quiz example; these files must be in the same folder as the main program and class files ; moreover, prompt.cpp must be added to the project as a source file)