Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 2 Lnai 9285

Authors: Annalisa Appice ,Pedro Pereira Rodrigues ,Vitor Santos Costa ,Joao Gama ,Alipio Jorge ,Carlos Soares

1st Edition

3319235249, 978-3319235240

More Books

Students also viewed these Databases questions