Write down the questions,
doubts, and surprises that you have on a piece of paper.
Assigned Work Due
Hand in your questions, doubts and surprises.
Input -- Topics to Review
Functions
UML [ uml0.html ]
The standard library for accessing files: fstream, ifstream, ofstream,...
Containers and iterators.
Inheritance and deriving a new class from an old one.
Declaring objects and declaring pointers.
Properties and uses of standard containers/data structures.
Single and doubly linked lists in C++. Fill in blanks in code. [ linked.html ]
Template classes and template functions. Fill in blanks in code. See previous labs and classes.
Predicting what templated linked data does: [ pq4a.cpp ]
for(int i=0; i<25; i++) cout << 'a'+i;
The 'a'+i is an int and so cout shows a number.... cast the data into a char:
for(int i=0; i<25; i++) cout << (char)('a'+i);
Please review containers and algorithms
[ alg.html ]
Is -> used only for functions?
No. It is also used to access data inside an object pointed at
by a pointer.
A common example would be:
this->dataexcept that C++ abbreviates the above to
data!!
As a rule you should always put pointers into containers rather than
the objects: this is faster, saves space, and lets objects behave
correctly.
Can you give us an example of a double linked list?
[ dll.cpp ]
When drawing in the UML is the word const used?
No. Not in the standard. In the standard you use the
stereotype <<query>> to indicate a C++ "const"
member function, if you really need to.
However, our Dia graphic program does use "const" instead of "<<query>>".
More on member functions
[ Functions%20in%20Classes in functions ]
Say more about virtual functions and polymorphism
[ polymorphism.html ]
More about templates?
[ templates.html ]
When should we use pointers and when iterators?
Whenever possible use an iterator to refer to places
in standard containers, or in non-standard containers
that define iterators.
Use a pointer to refer to another object that is not in a container,
or as an iterator to places in an array.
What do the visibility symbols in UML mean?
| Symbol | Meaning |
|---|---|
| + | public |
| - | private |
| # | protected |
Classes are boxes. In the boxes you can have a compartment for attributes (data) and operations (functions). Classes have three common links:
Here are some examples: [ Set.png ] [ SetIterator.png ]
My notes:
[ uml0.html ]
Composition and aggregation in UML
[ lookup.php?search=composition ]
(use only when you have a whole that has parts inside it).
[ lookup.php?search=aggreg ]
(deprecated.... use an association with an arrow not an uncolored diamond).
What is the purpose of a union?
The Union lets you have several meaning for one piece of storage.
So, it can save space. It is most useful for getting at parts of words
at the bit level. This is very useful for system programming.
As a rule unions are not used very much any more, except in system
programs.
What are the Basics of throw and catch?
(1) When poisoned a function can
throw up;and so terminate.
(2) When something is thrown some part of the program should be ready to catch the result....
catch ( Yucc up){ clean(up); }
My answer: to simulate co-functions and restartable code -- a simple to use form of concurrency. [ ../cs320/ ]
What is the most rewarding program that you've done that is still running?
[ ../cookie.php ]
. . . . . . . . . ( end of section CSci202 Computer Science II, Session 20 Review) <<Contents | End>>
Lab 10 on chapter 15
[ lab10.html ]
Next
The Final
[ final.html ]
Bring your final project 5 (resubmit) to the final.