As an example class, we use Robot class, which is not in the book, but a document (robotworld.pdf) that explains this class and how to use it is in robot.zip file. Moreover, all files needed for the robot class is in that zip file. simplerobot.cpp is the example program that we have seen in lecture. If you have not attended lectures this week, please first read the robotworld.pdf first or refer to lecture notes (classes.ppt). In this week's recitations, the use of robot class and some other example robot programs will be explained in detail. Since the third homework is about this robot class, it is to your benefit to attend the recitations.
This week, we also continued with Chapter 4 (4.5 - 4.6) of the textbook (Tapestry) to cover math functions and functions that return values. Some of the topics and example programs may not exist in the book (or may not exist in Chapter 4) (e.g. some string functions are not covered in Chapter 4). Follow the referrals in the funcs2.ppt file. All codes covered in class are given below. We did not have to cover string related functions (slides 14-23 in funcs2.ppt); we will continue with them next week.
Powerpoint files
classes.ppt
funcs2.ppt (slides 14-23 will be covered next
week)
C++ codes discussed in class (some of them might have been modified
in class to show extra features)
order.cpp
order2.cpp
area_func_return.cpp
isleap.cpp
isleap2.cpp
pizza2.cpp (this example is covered in recitations)
usemath.cpp
weekday.cpp
The following three samples will be covered next week.
strdemo.cpp
strfind.cpp
stringremove.cpp