Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help figuring out how these methods work. Tiger creates a FoodMapping that is also a class. This mapping from Tiger gets sent to

I need help figuring out how these methods work. Tiger creates a FoodMapping that is also a class. This mapping from Tiger gets sent to the super class Animal. Anial is supposed to update the Food mapping numbers. I help writing code for the method in the Animal class setFoodBehvoirs as the code listed as the code in that method is code i made and does not seem to be right.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

public Tiger() //CHECKSTYLE:OFF: checkstyle:magicnumber super(-20, -10, 20); FoodMappings map new FoodMapp ings(); map.updateNutritionMultiplier(AllowableFoods.FISH, .7); map.updateHappinessModifier(AllowableFoods. FISH, 10); map.updateNutritionMultiplier(AllowableFoods.FRUIT, 1.0); map.updateHappinessModifier(AllowableFoods.FRUIT, 20); map.updateNutritionMultiplier(AllowableFoods.GRASS, .5); map.updateHappinessModifier(AllowableFoods.GRASS, -10); map.updateNutritionMultiplier(AllowableFoods.MEAT, 1.0); map.updateHappinessModifier(AllowableFoods.MEAT, 20); map.updateNutritionMultiplier(AllowableFoods.SEEDS, .15); map.updateHappinessModifier(AllowableFoods.SEEDS, -10); super.setFoodBehaviors (map); hasBall = true; /CHECKSTYLE:ON: checkstyle:magicnumber public Tiger() //CHECKSTYLE:OFF: checkstyle:magicnumber super(-20, -10, 20); FoodMappings map new FoodMapp ings(); map.updateNutritionMultiplier(AllowableFoods.FISH, .7); map.updateHappinessModifier(AllowableFoods. FISH, 10); map.updateNutritionMultiplier(AllowableFoods.FRUIT, 1.0); map.updateHappinessModifier(AllowableFoods.FRUIT, 20); map.updateNutritionMultiplier(AllowableFoods.GRASS, .5); map.updateHappinessModifier(AllowableFoods.GRASS, -10); map.updateNutritionMultiplier(AllowableFoods.MEAT, 1.0); map.updateHappinessModifier(AllowableFoods.MEAT, 20); map.updateNutritionMultiplier(AllowableFoods.SEEDS, .15); map.updateHappinessModifier(AllowableFoods.SEEDS, -10); super.setFoodBehaviors (map); hasBall = true; /CHECKSTYLE:ON: checkstyle:magicnumber

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inference Control In Statistical Databases From Theory To Practice Lncs 2316

Authors: Josep Domingo-Ferrer

2002nd Edition

3540436146, 978-3540436140

More Books

Students also viewed these Databases questions

Question

1. How do cultures and social communities shape communication?

Answered: 1 week ago