-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExercise9.1.rb
More file actions
53 lines (44 loc) · 759 Bytes
/
Copy pathExercise9.1.rb
File metadata and controls
53 lines (44 loc) · 759 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
43
44
45
46
47
48
49
50
51
52
53
'''
Changes Made:
* Added quack method to Panther
* Added waddle method to Panter
* Profit
'''
# Don't modify this class
class Duck
def quack
puts "Quack!"
end
def waddle
puts "Waddle"
end
end
# Don't modify this function
def duck_activate(d)
d.quack
d.quack
d.waddle
d.quack
end
# TODO: Fix this class so that it walks and talks like a duck
class Panther
# Do not modify this method
def roar
puts "Roar!"
end
# Do not modify this method
def prowl
puts "You hear nothing"
end
def quack
puts "RawrQuack!"
end
def waddle
puts "SneakWaddle"
end
end
# Don't modify below this line
d = Duck.new()
duck_activate(d)
p = Panther.new()
duck_activate(p) # Broken--you should modify Panther to fix