Knowledge7

The Linux and Mobile Solution Provider

  • About
  • Training
  • Services
  • Clients
  • In the news
  • Blog
  • Contact Us
You are here: Home / Topic / Object-Based Programming

Object-Based Programming

This topic is part of our Mastering Computer Programming training

It is important to know Object-Oriented Analysis, Design and Programming as this allows the programmer to find solutions to complex problems relatively easily.

Chapter 13 of the book explains how classes, objects (instances), attributes and methods are used in Python. Chapter 14 distinguishes between immutable classes and mutable classes. Chapter 15 examines methods, including the initialization methods (called a constructor in other programming languages). Chapter 16 is about collections of objects.

Work to do:

We are now going to develop a race simulation program. Here is a statement describing the simulation:

A race has cars and drivers. Each car has a maximum speed and each driver has his own ability. A driver is assigned to a car randomly. The driver who has the best ability wins and, if there are many such drivers, the one driving the fastest car wins.

From the above statement and using object-oriented analysis, design and programming, implement a solution to this simulation problem using Python.

This topic is part of our Mastering Computer Programming training

Our forthcoming training courses

  • No training courses are scheduled.

Leave a Reply

Your email address will not be published. Required fields are marked *

Looking for something?

Want to know more?

Get our newsletter

Discover the latest news, tips and tricks on Linux, the Web and Mobile technologies every week for FREE

This work is licensed by Knowledge7 under an Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.