Question: Question 2 ( Using a Concrete Class ) : ? ? 1 5 ? ? ? Preparation: Create a new NetBeans project with a main

Question 2(Using a Concrete Class):
??15???
Preparation:
Create a new NetBeans project with a main() method called FightEvil with a package structure as oop.ct1.fightevil
Download and extra the needFilesCT1.zip from EC.
Add the provided SuperHero.jar file to the "Libraries" for FightEvil project.
Remember to Edit the SuperHero library and add the extracted "javadoc" folder as the Javadoc for this library.
Now complete the application as described below.
The question:
Consider the following scenario:
You have been provided with the SuperHero class, which represents a superhero with certain attributes such as name, gender, and strength level. Your task is
to create an application called FightEvil based on this class.
The FightEvil application simulates a year in which a superhero must protect the city "Pretoria". The application prompts the user to enter information to
create a superhero object, including the superhero's name and gender. Additionally, a random number is generated to represent the superhero's initial
strength level, which ranges from 20 to the maximum strength level.
During the simulation, which lasts for 365 days, the superhero faces two types of events: fighting evil or receiving praise. Each day, a random event occurs,
where 0 represents fighting evil and 1 represents receiving praise. The superhero cannot fight evil if the strength level is 0(the lowest level) and cannot
exceed the maximum strength level.
After the simulation, the application displays the superhero's state for the next year, including their name, gender, and strength level.
Your task is to implement the FightEvil application using the provided SuperHero class. Ensure that all input and output are handled using the JOptionPane
class and that random numbers are generated using the Random class.
 Question 2(Using a Concrete Class): ??15??? Preparation: Create a new NetBeans

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!