Zack runs a dog sitting service where he watches people's dogs for the day. He feeds each dog 2 bones per day, and he takes each dog on 3 walks per day. Zack charges 7 dollars per bone, and 12 dollars per walk.
Zack wrote the following function to determine how much to charge his customers. The function takes the number of dogs (num dogs) and number of days (num days) as input, and returns the total dollars charged as output.
To make his code correct though, he must replace the word CARNIVAL with an integer. What integer should he replace CARNIVAL with?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The answer is 12 .
twc is a variable holding the total walk cost for num_dogs dogs for num_days days. To calculate twc, you need to multiply (number of walks) by (cost per walk), which equals (num dogs * num days * 3) * 12.
If we look at the line:
We see that missing integer in the twc calculation is 12 .