Coder Social home page Coder Social logo

cars's Introduction

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.

cars's People

Contributors

alicjabonder avatar ziobron avatar ariionex avatar

Watchers

James Cloos avatar

Forkers

ariionex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.