|
 |
CS 3723
Programming Languages |
8.2 Examples of Classes
|
|
- Fractions:
Homework 11 (Fall 2014) had students finish writing a class
Fraction. (See
11: Fraction Class.)
- Date/Time:
Homework 12 (Fall 2014) had students finish writing a class involving
dates, times, and inheritance:
Time/Date. (See
12: Time/Date Classes.)
- Complex Numbers:
The final exam (Fall 2014) had students finish writing a class
Complex to implement complex numbers
(which are built-in with Python, but doing it "from scratch" here. (See
Final Answers.
The example is also given in PDF form at:
complex.pdf.)
- Shape class:
The final exam (Fall 2014) also had students work on an extension of the Shape
class at the end of the page on classes:
8.1 Intro. to Classes.
The example on the final included more inheritance. The complete
example is given at the end of:
Final Answers.
- Subset Algorithm:
The Subset Algorithm for simulating the actions of a DFA or of an
NFA (with or without ε-moves) is presented in the section
9.2 Using a Class
of these notes.
- Concordance Using Lists:
Tree can be implemented without pointers, but using lists:
6.1 Concordance Using Lists
- Trees Using Pointers:
A binary search tree and inorder traversal using conventional
pointers:
6.2 Trees Using Pointers.
(Revision date: 2014-11-23.
Please use ISO 8601,
the International Standard.)
|