Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Java programming for this problem and show the input and the output: (100 points) Design a battle scene in a video game. -

Please use Java programming for this problem and show the input and the output:

image text in transcribed

image text in transcribed

(100 points) Design a battle scene in a video game. - Create a maven project named cps278_mp2_xml - Add the spring dependencies to the project (same ones we used in learning unit 2) - Create a BattleGround Interface: with one abstract method "getBattleGroundDesc" (method should return String) - Create a FightingPower Interface: with one abstract method "getFightingPowerDesc" (method should return String) - Create a couple of implementations of BattleGround - Create a couple of implementations of FightingPower - Create a class called "Character". Character class should include: - Attributes: - name: String - health: double or int - strength: double or int - fightingPower: an implementation of FightingPower Interface - Method: - useFightingPower: sysout how the character fights using a particular fightingPower. name+getFightingPowerDesc. For example: "Tom Nook is throwing fireballs." - Create a class called "Battle". Battle class should include: - Attributes: - character1: Character Class - character2: Character Class - battleground: an implementation of BattleGround Interface - Method: - fight: sysout the information of the battleground and how each character uses their fightingPower. For example: "On Naboo, Tom Nook and KK Slider are fighting. Tom Nook is throwing fireballs. KK Slider is swing the master sword." Use the knowledges we learned in Learning Unit 2: First Try: (using XML bean configuration metadata and annotation) - Use @Component to create 2 FightingPower beans and 1 BattleGround bean. - Create 2 Character beans using bean configuration metadata (xml):the configuration file should be located in src/main/resources - Use annotation to create a Battle bean. Use annotation to inject all the dependencies in the Battle bean. - Create 2 java apps: - IOCApp1.java-this app should invoke the loC container using the FileSystemXmIApplicationContext - IOCApp2.java-this app should invoke the IoC container using the ClassPathXmIApplicationContext - Run both Java programs and make sure you see the right output. Second Try: (using Java Config) - Copy and paste cps278_mp2_xml, rename it to cps277_mp2_java_config - Remove the bean configuration metadata file (xml) - Create a Java Config file to configure all the beans. (see DI_JavaConfig_Demo2) - Run the Java program and make sure you still see the same output *Include constructors, getters and setters as needed *Have fun but please only make PG or PG13 battle scenes ()

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

Step: 3

blur-text-image

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

What magazine and ads did you choose to examine?

Answered: 1 week ago