Zack's dog sitting

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 (numdogs) and number of days (numdays) 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
    # Zack's python code
    # 
    # how_many_dollars()
    #
    # inputs: 
    #     num_dogs = number of dogs
    #     num_days = number of days
    # returns the total charge in dollars

    def how_many_dollars(num_dogs, num_days):
        bc = 7
        wc = 12
        bpd = 2
        wpd = 3

        tbc = bc * bpd * num_days * num_dogs
        twc = wpd * CARNIVAL * num_days * num_dogs

        return tbc + twc

×

Problem Loading...

Note Loading...

Set Loading...