czarny247 / Cars

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object-oriented C++

Assignment

  1. Design proper abstraction (interfaces)
  2. Apply inheritance
  3. Fix encapsulation
  4. Use polymorphism to represent every type of car, using a single pointer
  5. Fix a diamond problem
  6. Fix potential memory leaks
  7. Think about the way of keeping engines in cars. Should they be kept by a value, reference or a pointer (what kind of pointer)?
  8. Is this code testable?

Post-work

You can work in groups or individually. Please fork the repo and submit a Pull Request after you have finished.

  1. Create InvalidGear exception. It should be thrown when someone tries eg. change a gear from 5 to R. It should inherit from one of STL exceptions
  2. Fix interfaces to be easy to use correctly and hard to use incorrectly (like accelerate(-999))
  3. (Optional) Write proper unit tests to this code.
  4. Read one of below articles. It will be useful for the next lesson.

About


Languages

Language:C++ 80.8%Language:CMake 19.2%