Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me complete this please? Here is the program I'm working on: And this is the driver to fix and attach. I'm still
Can someone help me complete this please?
Here is the program I'm working on:
And this is the driver to fix and attach.
I'm still learning to work on this, so help is greatly appreciated.
public class SuperHero public static void main(String[ args) //Instance variables private static int numberOfHeroes private string heroName private string secretIdentity private int numberOfLifeChances private int number0fPeopleSaved /Two constructors public SuperHero(String initHeroName, String initSecretIdentity, int initPeopleSaved) number0fHeroes++ //one more hero created number0fLifeChances = 2; // start the hero with two lives heroName = in!the roName; secret!dentity = initSecretIdentity; number0tPeopleSaved = initPeopleSaved; public SuperHero(String intHeroName) heroName initHeroName; number0fHeroes++ //one more hero created number0fLifeChances = 2; // start the hero with two lives sesretyIdentity"unknown"; number0tPeopleSaved = 0; // Methods / /getNumberofHeroes) public int getNumberOfHeroes () return number0fHeroes; //recordSave() public void recordSave) I number0fPeopleSaved+ //the second recordSave public void recordSave(int num) number0tPeopleSaved+=num; //killHero() public void killHero) if (numberOfLifeChances) System.out.println("Hero is dead!"); esle number0fLifeChances-- //printSuperHeroRecord) public void printSuperHeroRecord) 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started