1. Virtual Laboratories
  2. Object Library
  3. Devices
  4. Coin

Coin

Description

This class defines a coin with specified colors, value, and probability of heads. The state of the coin can be tossed or not tossed. If tossed, the coin is drawn with a color and label that depend on the outcome (heads or tails). If not tossed, the coin is shown as an outline in the background color. This object is used, for example, in the coin-die experiment

A coin showing tails A coin showing heads

Class Hierarchy

Code

The text area below gives the code for this object, so that you can browse the constructors, methods, and properties of the object. Of course, this source file is part of devices.zip, which contains all source and resource files for the objects in the devices package.