Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRTE JAVA CODE. Thanks in advance :) That's the question ----> Aim: Understanding structured program development using repetition structures (loops); understanding the fundamentals in

PLEASE WRTE JAVA CODE. Thanks in advance :)
image text in transcribed
image text in transcribed
That's the question ----> image text in transcribed
image text in transcribed
Aim: Understanding structured program development using repetition structures (loops); understanding the fundamentals in object-oriented programming; understanding the methods. In this project, you need to form an alliance for a quest that consists of 6 people from 2 different races as Wizard and Elf. You will implement a Java class for each race and you will define a separate class Quest (driver class) that contains a main method to test the other classes. The class Wizard contains the following private instance variables and public methods: You need to store the wizard's name, the wizard's age and the wizard's staffHeight. The class should contain the corresponding public set/get methods. The class should contain a public display method to print out the information about the Wizard object (instance). The method returns no value. The class should contain another method called castSpell to calculate and print out the power of a spell casted by the wizard. The method returns no value. The the wizard's age formula of the power calculation is the following: e staff Height The class Elf contains the following private instance variables and public methods: You need to store the elf's name, the elf's age and the elf's bowLength. The class should contain the corresponding public set/get methods. the wizard's age formula of the power calculation is the following: e stafHeight The class Elf contains the following private instance variables and public methods: You need to store the elf's name, the elf's age and the elf's bowLength. The class should contain the corresponding public set/get methods. The class should contain a public display method to print out the information about the Elf object (instance). The method returns no value. The class should contain another method called shootArrow to calculate and print out the power of an arrow shot by the elf. The method returns no value. The formula of the power calculation is the following: Vthe elf's age * bowLength In the driver class Quest, you need to use a loop to create an alliance of 6 people from different races. At least one person from each race must be selected for this alliance, the remaining people can be selected from any race by the user. (As you can understand, you need to use a decision structure (switch-case, if-else) in the loop to create the selection of races.) Create 6 people in total. For each person, set the corresponding data members, display the information and print out the power of the corresponding weapon of the person. At the end, the program must print out the number of people created from each race. Aim: Understanding structured program development using repetition structures (loops); understanding the fundamentals in object-oriented programming; understanding the methods. In this project, you need to form an alliance for a quest that consists of 6 people from 2 different races as Wizard and Elf. You will implement a Java class for each race and you will define a separate class Quest (driver class) that contains a main method to test the other classes. The class Wizard contains the following private instance variables and public methods: You need to store the wizard's name, the wizard's age and the wizard's staffHeight. The class should contain the corresponding public set/get methods. The class should contain a public display method to print out the information about the Wizard object (instance). The method returns no value. The class should contain another method called castSpell to calculate and print out the power of a spell casted by the wizard. The method returns no value. The the wizard's age formula of the power calculation is the following: e staff Height The class Elf contains the following private instance variables and public methods: You need to store the elf's name, the elf's age and the elf's bowLength. The class should contain the corresponding public set/get methods. The class should contain a public display method to print out the information about the Elf object instance). The method returns no value. The class should contain another method called shootArrow to calculate and print out the power of an arrow shot by the elf. The method returns no value. The formula of the power calculation is the following: Vthe elf's age * bowLength In the driver class Quest, you need to use a loop to create an alliance of 6 people from different races. At least one person from each race must be selected for this alliance, the remaining people can be selected from any race by the user. (As you can understand, you need to use a decision structure (switch-case, if-else) in the loop to create the selection of races.) Create 6 people in total. For each person, set the corresponding data members, display the information and print out the power of the corresponding weapon of the person. At the end, the program must print out the number of people created from each race

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

=+2. Are you surprised by the results?

Answered: 1 week ago

Question

Explain the concept of employment at will.

Answered: 1 week ago

Question

Define and measure service productivity.

Answered: 1 week ago