Use the Unified Modelling language.
A very rough UML scetch is an easy and fast way to start thinking about any new class you are about to code. Engineers have a tradition of using napkins for this kind of design.
Remember that when you are stuck writing or debugging code, it helps
to shift to pictures and diagrams. Rough UML can help.
Main Program should test classes
When asked to develop one or more classes you should
also develop and hand in a main program that tests the classes.
A test of a class is called a "Unit Test".
The main program is a good place for a rough picture of all classes
tested and all tested connections between them.
I find that wrting the tests first helps me understnad the classes I have to write better. I use
#include <cassert>so that the main program can test that an operation/method/function works
assert( object.operation(data) == expected_result);
I'll try to demo this in a lecture/discussion.
Common Syntax errors in C++ classes
Working faster
Make some blank .h and .cpp files for a Blank class and Operations.
10.8 Savings Account class
10.9 IntegerSet class
I would start with the driver program and add one feature at a time.
11.15 RationalNumber class
11.17 Polynomial class
. . . . . . . . . ( end of section Project 2 Classes) <<Contents | End>>
Abbreviations