Question: You will be responsible for creating a system that manages heroes and their combat teams. Every hero hasSkills and can belong to a team of

You will be responsible for creating a system that manages heroes and their combat teams. Every hero hasSkills and can belong to a team of superheroes. Teams can be updated throughout theTime, and each hero has specific characteristics that must be programmed.You can use kotlin playground Part 1: Declaration of Heroes (var and val)1. Create two heroes using val (immutable) and one hero using var (changeable). The characteristics of these Heroes are:A) name (val): the name of the hero.B) Secret identity (val): civil name of the hero.C) power (var): the main power that can change over time.D) force (var): the hero's strength level (1 to 100), which can be changed during battles.2. Initialise the heroes and change the power of one of them (using the var) throughout the work development.Part 2: Superhero Team (Changeable and Immutable Lists)1. Create a Team class that has a list of heroes. The team must be initialized with a listImmutable of 3 heroes.2. Add methods to the Team class to allow:A) Add a hero (the team grows over time).B) Remove a hero (when the hero abandons or is replaced).C) Use a changeable list to make these dynamic updates.3. Create a team of heroes and add two more heroes to the team using the addition function, in addition to remove a hero at another time.Part 3: Classes and Heritage1. Create a base class called Heroi, which contains:A) Attributes such as name, secret identity, power and strength.B) A present() method that prints a brief description of the hero (name and power).C) A fighting method() that prints "Hero fighting with power: X", where X is the name of the power of the Hero.2. Create three subclasses of heroes who inherit from Heroi:A) Flying Hero: hero with the ability to fly. Overwrite the fight() method to indicate that it It's flying while fighting.B) HeroForce: hero who has super strength. Overwrite the fight() method to print that he uses Gross force.C) Technological Hero: hero who uses technology. Overwrite the fight() method to indicate that he uses Technological gadgets.3. Create instances of each of these subclasses, use the present() method and make the heroes fight With your specific skills.Part 4: Overloading Properties and Functions1. Modify the Heroi class to include a resistance property (a number from 1 to 100) and Overwrite in the subclasses:A) For the HeroStrength, resistance should increase by 20% after each fight.B) For the Flying Hero, the resistance decreases by 10% after each flight.C) For the Technological Hero, the resistance is adjusted depending on the use of the gadgets, increasing In 5%.2. Overwrite the fight() function in each subclass so that it also shows the current value of the Hero's resistance.Requirements The code must be written in Kotlin and executed without errors. Each class and method must be correctly implemented according to the requirementsSpecified.You will be responsible for creating a system that manages heroes and their combat teams. Every hero hasSkills and can belong to a team of superheroes. Teams can be updated throughout theTime, and each hero has specific characteristics that must be programmed.You can use kotlin playground Part 1: Declaration of Heroes (var and val)1. Create two heroes using val (immutable) and one hero using var (changeable). The characteristics of theseHeroes are:A) name (val): the name of the hero.B) Secret identity (val): civil name of the hero.C) power (var): the main power that can change over time.D) force (var): the hero's strength level (1 to 100), which can be changed during battles.2. Initialise the heroes and change the power of one of them (using the var) throughout theWork development.Part 2: Superhero Team (Changeable and Immutable Lists)1. Create a Team class that has a list of heroes. The team must be initialized with a listImmutable of 3 heroes.2. Add methods to the Team class to allow:A) Add a hero (the team grows over time).B) Remove a hero (when the hero abandons or is replaced).C) Use a changeable list to make these dynamic updates.3. Create a team of heroes and add two more heroes to the team using the addition function, in addition toRemove a hero at another time.Part 3: Classes and Heritage1. Create a base class called Heroi, which contains:A) Attributes such as name, secret identity, power and strength.B) A present() method that prints a brief description of the hero (name and power).C) A fighting method() that prints "Hero fighting with power: X", where X is the name of the power of theHero.2. Create three subclasses of heroes who inherit from Heroi:A) Flying Hero: hero with the ability to fly. Overwrite the fight() method to indicate that itIt's flying while fighting.B) HeroForce: hero who has super strength. Overwrite the fight() method to print that he usesGross force.C) Technological Hero: hero who uses technology. Overwrite the fight() method to indicate that he usesTechnological gadgets.3. Create instances of each of these subclasses, use the present() method and make the heroes fightWith your specific skills.Part 4: Overloading Properties and Functions1. Modify the Heroi class to include a resistance property (a number from 1 to 100) andOverwrite in the subclasses:A) For the HeroStrength, resistance should increase by 20% after each fight.B) For the Flying Hero, the resistance decreases by 10% after each flight.C) For the Technological Hero, the resistance is adjusted depending on the use of the gadgets, increasingIn 5%.2. Overwrite the struggle() function in each subclass so that it also shows the current value of theHero's resistance.Requirements The code must be written in Kotlin and executed without errors. Each class and method must be correctly implemented according to the requirements Specified. Lists must be handled as requested (immutable and changeable). The inheritance and overload of methods and properties must be properly applied Lists must be handled as requested (immutable and changeable). The inheritance and overload of methods and properties must be properly applied

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 Programming Questions!