Kapitel 5 - Programm 12 - VERWDAT.CPP

zurück...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
					// Kapitel 5 - Programm 12 - VERWDAT.CPP
// Ein sehr einfacher Test der Datumsklasse

#include <iostream>
#include "datum.h"

int main(void)
{
Datum Heute, Geburtstag;

   Geburtstag.SetzeDatum(5, 30, 1978);
   std::cout << "Einfacher Test der Klasse Datum\n";
   std::cout << "Heute ist " << Heute.HoleFormatiertesDatum() << "\n";
   std::cout << "Mein Geburtstag ist " << Geburtstag.HoleFormatiertesDatum() << "  (wirklich!)\n";

   Heute.SetzeFormat(4);
   std::cout << "Heute ist " << Heute.HoleFormatiertesDatum() << "\n";
   std::cout << "Mein Geburtstag ist " << Geburtstag.HoleFormatiertesDatum() << "\n";

   return 0;
}


// Ergebnis beim Ausführen
//
// Einfacher Test der Klasse Datum
// Heute ist Feb 5, 1994
// Mein Geburtstag ist Mai 30, 1978  (wirklich!)
// Heute ist 5 Feb 1994
// Mein Geburtstag ist 30 Mai 1978

zurück...