Yurttas/PL/OOL/Cplusplus/F/04/02/03/00/animals 02.cpp

From ZCubes Wiki
Revision as of 23:29, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="cpp" line start="1" enclose="div">/* Copyright(C) 2001 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. Perm...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/*
 2   Copyright(C) 2001
 3   All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4
 5   Permission to use, copy, modify, and distribute this
 6   software and its documentation for EDUCATIONAL purposes
 7   and without fee is hereby granted provided that this
 8   copyright notice appears in all copies.
 9
10   date   : June 1, 2001.
11   author : Salih Yurttas.
12
13   animals_02.cpp
14*/
15
16
17#include <iostream>
18
19using namespace std;
20
21#include "Animal.h"
22#include "Mammals.h"
23#include "Birds.h"
24#include "Land.h"
25#include "Sea.h"
26
27void animals_out(Animal*,
28                 const char*,
29                 const char*,
30                 const int);
31
32int main(int argc, char* argv[]) {
33
34  Animal* a0 = new Animal;
35
36  animals_out(a0,
37              "Animal",
38              "A0",
39              7);
40
41  a0 = new Mammals;
42
43  animals_out(a0,
44              "Mammal",
45              "M0",
46              1);
47
48  a0 = new Birds;
49
50  animals_out(a0,
51              "Bird",
52              "B0",
53              2);
54
55  a0 = new Sea;
56
57  animals_out(a0,
58              "Sea",
59              "S0",
60              1);
61
62  a0 = new Land;
63
64  animals_out(a0,
65              "Land",
66              "L0",
67              2);
68
69}