Question
My Assignment in Java: This assignment involves writing a program that models a super hero. A super hero has a name, wears a special suit
My Assignment in Java: This assignment involves writing a program that models a super hero. A super hero has a name, wears a special suit when performing hero duties, might wear a cape, and has a birth date. A super hero is also able to invoke his/her special powers when called on to do so. Implement a class named SuperHero that models the above description. Use a Name class to represent the name attribute, and a Date class to represent the birth date attribute. You may use the Date class from the lectures or define your own. If the super hero is wearing their special suit, then the suit attribute should indicate this. Similarly, if the super hero is wearing a cape, then a cape attribute should indicate this. String types can be used for these two attributes. There should also be an attribute that indicates whether the super hero is invoking their special powers, and a method to set and unset the special powers attribute. Provide appropriate class constructors, getter methods, setter methods, and any other methods you think are necessary to model a super hero. Write a main method that creates an array of SuperHero objects and displays their attributes and displays whether their super powers are being invoked. Please keep this simple, thanks.
Step 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