4. pet_shopping_list For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets. PLAN FOR THIS FUNCTION: . determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain "mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular. build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food", "mouse treats", "mouse bed", "mouse house"] Sample calls should look like: >>> pet_shopping list("mice") ['mouse food', 'mouse treats', 'mouse bed', mouse house'] >>> pet_shopping list("foxes") ['fox food', 'fox treats', 'fox bed', 'fox house1 >>> pet_shopping list("giraffe") ['giraffe food', 'giraffe treats', 'giraffe bed', 'giraffe house'] >>> pet_shopping list("raccoons") ['raccoon food "raccoon treats', 'raccoon bed', 'raccoon house ]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.5: Case Studies
Problem 3E
icon
Related questions
Question
/courses/46018/assignments/296094
>>> sum_of_greatest two(3, 100.900)
1000
4. pet_shopping_list
For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house --
but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and
returns a shopping list for your pet or pets.
PLAN FOR THIS FUNCTION:
determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain
"mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the
final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular.
build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food",
"mouse treats", "mouse bed", "mouse house"]
Sample calls should look like:
>>> pet_shopping list("mice")
I'mouse food', 'mouse treats',
"mouse bed',
"mouse house']
>>> pet_shopping_list("foxes")
Fox food', 'fox treats', 'fox bed", 'fox house']
>>> pet_shopping list("giraffe")
['giraffe food"
'giraffe treats', 'giraffe bed, 'giraffe house]
>>> pet_shopping list("raccoons")
I'raccoon food',
raccoon treats', 'raccoon bed', 'raccoon house'1
5. calculate new_balance
Given a starting balance (a number), and a list of transaction tuples, calculate the final balance for an account.
Transaction tuples are of the shape ("description" amount
. "w
thdrawal") or ("description". amount, "deposit"). The last
Transcribed Image Text:/courses/46018/assignments/296094 >>> sum_of_greatest two(3, 100.900) 1000 4. pet_shopping_list For the purposes of this question, if you have a pet of a certain type, that pet needs food, treats, a bed and a house -- but multiple animals of the same kind can share. This function takes what kind of animal or animals you have and returns a shopping list for your pet or pets. PLAN FOR THIS FUNCTION: determine the word for a single kind of the animal. if the input is "mice", then we want the output to contain "mouse" (don't worry about any other unusual plurals). Otherwise, look for words that end with "es" and remove the final "es", so "foxes" goes to "fox". Otherwise, remove a final "s". Otherwise, assume that the word is singular. build and return a shopping list, which will be a list of strings. shopping lists should be in the shape: ["mouse food", "mouse treats", "mouse bed", "mouse house"] Sample calls should look like: >>> pet_shopping list("mice") I'mouse food', 'mouse treats', "mouse bed', "mouse house'] >>> pet_shopping_list("foxes") Fox food', 'fox treats', 'fox bed", 'fox house'] >>> pet_shopping list("giraffe") ['giraffe food" 'giraffe treats', 'giraffe bed, 'giraffe house] >>> pet_shopping list("raccoons") I'raccoon food', raccoon treats', 'raccoon bed', 'raccoon house'1 5. calculate new_balance Given a starting balance (a number), and a list of transaction tuples, calculate the final balance for an account. Transaction tuples are of the shape ("description" amount . "w thdrawal") or ("description". amount, "deposit"). The last
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr