-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
42 lines (24 loc) · 849 Bytes
/
main.cpp
File metadata and controls
42 lines (24 loc) · 849 Bytes
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
#include <iostream>
#include <string>
#include <gtest/gtest.h>
#include <gmock/gmock.h>
#include "WildDuck.h"
#include "Flywithwinds.h"
#include "FlyNoWay.h"
#include "Quack.h"
#include "MuteQuack.h"
int main(int argc, char **argv)
{
Duck *wildDuck = new WildDuck(new FlyWithWinds(), new Quack());
std::string wildDuckFlyResult = wildDuck->perfomFly();
std::cout << wildDuckFlyResult << '\n';
std::string wildDuckQuackesult = wildDuck->perfomQuack();
std::cout << wildDuckQuackesult << '\n';
Duck *rubberDuck = new WildDuck(new FlyNoWay(), new MuteQuack());
std::string rubberDuckFlyResult = rubberDuck->perfomFly();
std::cout << rubberDuckFlyResult << '\n';
std::string rubberDuckQuackResult = rubberDuck->perfomQuack();
std::cout << rubberDuckQuackResult << '\n';
delete wildDuck;
return 0;
}