-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
67 lines (61 loc) · 2.49 KB
/
main.cpp
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
59
60
61
62
63
64
65
66
67
#include <iostream>
#include "doggo.h"
using namespace std;
int main() {
// create object and var for later
Doggo dog;
int userInt;
// program navigation instructions
cout << "----------------------------------------------------------------------" << endl;
cout << " _ __ _ " << endl;
cout << " | | " << endl;
cout << " ---------- " << endl;
cout << " /\\___/\\ " << endl;
cout << " / o o \\ " << endl;
cout << " / . @ . \\_____________________ " << endl;
cout << " | ''' | \\ " << endl;
cout << " | | | " << endl;
cout << " | | | " << endl;
cout << " \\ ___ _ |/ " << endl;
cout << " \\ | ________/ \\ | \\ | d" << endl;
cout << " |__|__| |__| |__| sam " << endl << endl;
cout << "Press 1 for yes and 2 for no when prompted. 'Enter' advances the text." << endl;
cout << "----------------------------------------------------------------------" << endl;
// instruct the user, get their input, and store it
cout << "There is a dog!" << endl;
cout << "Would you like to give the dog a hat? [1 or 2]" << endl;
cin >> userInt;
dog.setDogHat(userInt);
// a try-catch for inquisitive little coders
try {
if (userInt > 999) {
throw userInt;
}
}
catch(int userInt) {
cout << "That sure was a big number!"<< endl;
}
// provide story based on user integer input
switch(dog.getDogHat()){
case 1:
cout << "The dog likes the hat! <3" << endl;
break;
case 2:
getchar();
cout << "The hat is ticking?!" << endl;
getchar();
cout << "." << endl;
getchar();
cout << ".." << endl;
getchar();
cout << "..." << endl;
getchar();
cout << "BOOM" << endl;
getchar();
cout << "You saved the dog's life." << endl;
break;
default:
cout << "The dog vanishes." << endl;
}
return 0;
}