static void Main(string[] args) { // Non-adapted chemical compound Compound unknown = new Compound("Unknown"); unknown.Display(); // Adapted chemical compounds Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); // Wait for user Console.ReadKey(); }
internal static void Main(string[] args) { ICompound water = new RichCompound("Water"); water.Display(); ICompound benzene = new RichCompound("Benzene"); benzene.Display(); ICompound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
public static void Main() { ICompound water = new RichCompound("Water"); water.Display(); ICompound benzene = new RichCompound("Benzene"); benzene.Display(); ICompound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
internal static void Main(string[] args) { ICompound water = new RichCompound("Water"); water.Display(); ICompound benzene = new RichCompound("Benzene"); benzene.Display(); ICompound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
static void Main(string[] args) { // Adapted chemical compounds ICompound water = new RichCompound("Water"); water.Display(); ICompound benzene = new RichCompound("Benzene"); benzene.Display(); ICompound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
static void Main(string[] args) { Compound unknown = new Compound("Unknown"); unknown.Display(); Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); Console.ReadKey(); }
public static void Run() { Console.WriteLine("\n Adapter Real World Practice"); Compound unknown = new Compound("Unknown"); unknown.Display(); Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
/// <summary> /// Entry point into console application. /// </summary> static void Main() { // Non-adapted chemical compound Compound unknown = new Compound("Unknown"); unknown.Display(); // Adapted chemical compounds Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); // Wait for user Console.ReadKey(); }
static void Main(string[] args) { Compound unknown = new Compound("Unknown"); unknown.Display(); Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); Console.ReadKey(); }
static void Main() { // Non-adapted chemical compound Compound unknown = new Compound("Unknown"); unknown.Display(); // Adapted chemical compounds Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); }
static void Main(string[] args) { //Non Adaped chemical compound Compound unkown = new Compound("unknown"); unkown.Display(); //Adapted chemical compounds Compound water = new RichCompound("WATER"); water.Display(); Compound benzene = new RichCompound("BENZENE"); benzene.Display(); Compound ethanol = new RichCompound("ETHANOL"); ethanol.Display(); }
public static void Run() { Console.WriteLine("This real-world code demonstrates the use of a legacy chemical databank. Chemical compound objects access the databank through an Adapter interface."); Compound unknown = new Compound("Unknown"); unknown.Display(); Compound water = new RichCompound("Water"); water.Display(); Compound benzene = new RichCompound("Benzene"); benzene.Display(); Compound ethanol = new RichCompound("Ethanol"); ethanol.Display(); /* * Compound: Unknown ------ * * Compound: Water ------ * Formula: H20 * Weight : 18.015 * Melting Pt: 0 * Boiling Pt: 100 * * Compound: Benzene ------ * Formula: C6H6 * Weight : 78.1134 * Melting Pt: 5.5 * Boiling Pt: 80.1 * * Compound: Alcohol ------ * Formula: C2H6O2 * Weight : 46.0688 * Melting Pt: -114.1 * Boiling Pt: 78.3 */ }