-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLottery_Main.cpp
More file actions
58 lines (48 loc) · 1.32 KB
/
Lottery_Main.cpp
File metadata and controls
58 lines (48 loc) · 1.32 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// ===========================================================================
// Lottery_Main.cpp
// ===========================================================================
#include "Lottery.h"
#include <iostream>
#include <algorithm>
static void testLottery01()
{
Lottery lottery(123);
lottery.play();
lottery.print();
}
static void printDrawNumber(int number) {
std::cout << "> " << number << std::endl;
}
static void testLottery02()
{
std::cout << std::endl;
std::cout << "Ziehung der Lottozahlen:" << std::endl;;
std::cout << "========================" << std::endl;;
// using std::for_each
Lottery lottery(123);
std::for_each(
lottery.begin(),
lottery.end(),
printDrawNumber
);
}
static void testLottery03()
{
std::cout << std::endl;
std::cout << "Ziehung der Lottozahlen:" << std::endl;;
std::cout << "========================" << std::endl;;
// using range-based for loop
Lottery lottery(123);
for (int number : lottery) {
std::cout << "> " << number << std::endl;
}
}
void exerciseLotto()
{
testLottery01();
testLottery02();
testLottery03();
}
// ===========================================================================
// End-of-File
// ===========================================================================