-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKittyGenerator
201 lines (156 loc) · 5.06 KB
/
KittyGenerator
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
using System;
using static System.Console;
namespace Kitty
{
class Program
{
static void Main(string[] args)
{
Title = "Kitty generator by Ishan Dutta";
printintro intro = new printintro();
Mammal pet;
pet = new Cat("Bernie", true, 12, 30, "Doll");
pet = new Cat("Torris", false, 11, 33, "Bone");
pet = new Cat("Comstock", true, 4, 10, "Water Gun" );
pet = new Cat("Miles", false, 5, 23);
pet = new Cat("Tyler", false, 2, 7, "Puppet", false);
ReadKey();
}
}
class Mammal
{
public int Age;
public bool HasHair;
public string Name;
public int Weight;
public string check;
public void About()
{
if (HasHair == true)
{
check = "very beautiful hair.";
}
else if (HasHair == false)
{
check = "no hair.";
}
WriteLine("\n\nMy name is " + Name + ". I am " + Age + " years old. I am about " + Weight + " pounds. I have " + check);
}
public Mammal()
{
}
}
class Cat : Mammal
{
string MeowSound;
Toy MyToy = new Toy(); //containment
LitterBox box = new LitterBox(); //containment
public Cat (string name, bool hasHair, int age, int weight) //without toy and clean
{
Name = name;
HasHair = hasHair;
Age = age;
Weight = weight;
About();
}
public Cat (string name, bool hasHair, int age, int weight, string toyname) //with toy and without clean
{
Name = name;
HasHair = hasHair;
Age = age;
Weight = weight;
About();
MyToy.Name = toyname; // containment
Write(Name);
MyToy.play();
GiveToy(MyToy);
}
public Cat(string name, bool hasHair, int age, int weight, string toyname, bool cleanCheck) //with toy and clean
{
Name = name;
HasHair = hasHair;
Age = age;
Weight = weight;
About();
MyToy.Name = toyname;
Write(Name);
MyToy.play();
WriteLine();
GiveToy(MyToy);
box.isClean = cleanCheck;
ForegroundColor = ConsoleColor.Red;
if (cleanCheck == true)
{
WriteLine("\nBox is clean.");
}
else if (cleanCheck == false)
{
WriteLine("\nBox is not clean.");
}
ResetColor();
}
public void AboutCat()
{
}
public void GiveToy(Toy t) //association
{
t.happy();
}
public void Play(string play_)
{
}
public void UseLitterBox(LitterBox lb)
{
lb.cleaning();
}
}
class LitterBox
{
public bool isClean;
public string Location;
public LitterBox()
{
}
public void cleaning()
{
WriteLine("The litter box is now clean.");
}
}
public class Toy
{
public string Name;
public void play()
{
Write(" is playing with " + Name);
}
public void happy()
{
ForegroundColor = ConsoleColor.Cyan;
WriteLine("\nI'm so happy");
ResetColor();
}
}
class printintro
{
public void print()
{
WriteLine(@" ___ ___ ___ ___
( ) .-. ( ) ( ) .-. ( )
| | ___ ( __) | |_ | |_ ___ ___ .-.. ___ .-. ( __) ___ .-. | |_
| | ( ) (''"") ( __) ( __) ( )( ) / \ ( ) \ (''"") ( ) \ ( __)
| | ' / | | | | | | | | | | ' .-, ; | ' .-. ; | | | .-. . | |
| |,' / | | | | ___ | | ___ | | | | | | . | | / (___) | | | | | | | | ___
| . '. | | | |( ) | |( ) | ' | | | | | | | | | | | | | | | |( )
| | `. \ | | | | | | | | | | ' `-' | | | | | | | | | | | | | | | | |
| | \ \ | | | ' | | | ' | | `.__. | | | ' | | | | | | | | | | ' | |
| | \ . | | ' `-' ; ' `-' ; ___ | | | `-' ' | | | | | | | | ' `-' ;
(___ ) (___) (___) `.__. `.__. ( )' | | \__.' (___) (___) (___)(___) `.__.
; `-' ' | |
.__.' (___) ");
}
public printintro()
{
print();
}
}
}