Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. 120 points) For this exercise, you are given a class (Action.-java) with two interfaces to start building action characters needed to become Superman and

image text in transcribed

3. 120 points) For this exercise, you are given a class (Action.-java) with two interfaces to start building action characters needed to become Superman and yourself. Download the codes (Action.java) from elearn and study the codes carefully. You can run the down loaded program without any change. It should display the following: 1. (14 points) Abstract class exercise You are given two abstract classes with no abstract method in the NoGo java file. The purpose of this exercise is to get familiar with abstract class and its object creation. I am Superman I can do the following fight bad guys fly faster than a bird Follow the steps below (be sure to comment on each step to score points) 1) (2 points) Use the NoGo.java file to show that you cannat create an instance of these two classes 2) (3 points) Create a subclass Gol with Nogol as its super class and create G0 constructor that 3) (2 points) Now inside the NeSe class create an instance of Go1, you should be able to run it. 4) (2 points) In Nogo2 class (abstract) add an abstract method as the following: 5) (2 points) Create a new class Go9 that extends the Nogo2 class to overnde the pMetbod () 6) (2 points) In Nosoclass (the one with the main)), create a Go9 object and launch the To be Superman, you need to add a few more action interfaces: (10 points) print a "Go1message What is the display? Please explain what happen. abstract vold nMethod method. Make the constructor for Go9) display Go9 Using the code from the following as reference nterface CanpishtLenid fight):1 Add an Interface called Caniy Add an interface called Canclimb Add an interface called Canswim The Canswim has two abstract methods. They are Metbodl void swimEastl: vold treadH200 Run NoSprogram, You should see the following display:1 points) NoGo1) Go1) Go9) get Methed) out of abstraction You need to modify the Action class to implement the new interfaces. You also need to add "yourself ivourName) as another class type as that of Superman. L5 points) You need to modify the Action class (the one with the main[))to make your final result looks like the following: I am Suc can do the following fight bad guys Swim faster than Michael Phelps Tread water forever fly faster than a bird climb vertical cliffs 2. (8 points) Interface Class Exercise. The purpose of this question is to exercise the mechanics of implementing the methods of Interface class imported from another package. In your Eclipse project (eg Assignment5), create a package ea As5 import). In the package (AS5 import), create two intertace classes and call it SayWhatt Saywhatz e all fight as an ecticbar The interface class SayWhat1 has two methods (void countooe, and void countT.00). The other interface class SayWhat2 has one method (void gountTwo I am ranes, Bond, I can do this: Peace no War! Not so fast in swimmi ng In the same project create another package (eg Assiqn5_2), and build a class (eg Class SaySometbing))to implement the interface (SayWhat1 and SayWhat2) such that countOne) displays "ONE., displays 'Two, and G9UOLURg() displays 'Three' 18 nins treading water Don't know how to fly climb a little ne all fight as an stinChar Write a test program (the one with the maintod splay the tollowing: One Three notice there are two fight() method in the list. How do you separate them? Suppose you want the "two fights" associated to their own type, what do you do? (5 points) 3. 120 points) For this exercise, you are given a class (Action.-java) with two interfaces to start building action characters needed to become Superman and yourself. Download the codes (Action.java) from elearn and study the codes carefully. You can run the down loaded program without any change. It should display the following: 1. (14 points) Abstract class exercise You are given two abstract classes with no abstract method in the NoGo java file. The purpose of this exercise is to get familiar with abstract class and its object creation. I am Superman I can do the following fight bad guys fly faster than a bird Follow the steps below (be sure to comment on each step to score points) 1) (2 points) Use the NoGo.java file to show that you cannat create an instance of these two classes 2) (3 points) Create a subclass Gol with Nogol as its super class and create G0 constructor that 3) (2 points) Now inside the NeSe class create an instance of Go1, you should be able to run it. 4) (2 points) In Nogo2 class (abstract) add an abstract method as the following: 5) (2 points) Create a new class Go9 that extends the Nogo2 class to overnde the pMetbod () 6) (2 points) In Nosoclass (the one with the main)), create a Go9 object and launch the To be Superman, you need to add a few more action interfaces: (10 points) print a "Go1message What is the display? Please explain what happen. abstract vold nMethod method. Make the constructor for Go9) display Go9 Using the code from the following as reference nterface CanpishtLenid fight):1 Add an Interface called Caniy Add an interface called Canclimb Add an interface called Canswim The Canswim has two abstract methods. They are Metbodl void swimEastl: vold treadH200 Run NoSprogram, You should see the following display:1 points) NoGo1) Go1) Go9) get Methed) out of abstraction You need to modify the Action class to implement the new interfaces. You also need to add "yourself ivourName) as another class type as that of Superman. L5 points) You need to modify the Action class (the one with the main[))to make your final result looks like the following: I am Suc can do the following fight bad guys Swim faster than Michael Phelps Tread water forever fly faster than a bird climb vertical cliffs 2. (8 points) Interface Class Exercise. The purpose of this question is to exercise the mechanics of implementing the methods of Interface class imported from another package. In your Eclipse project (eg Assignment5), create a package ea As5 import). In the package (AS5 import), create two intertace classes and call it SayWhatt Saywhatz e all fight as an ecticbar The interface class SayWhat1 has two methods (void countooe, and void countT.00). The other interface class SayWhat2 has one method (void gountTwo I am ranes, Bond, I can do this: Peace no War! Not so fast in swimmi ng In the same project create another package (eg Assiqn5_2), and build a class (eg Class SaySometbing))to implement the interface (SayWhat1 and SayWhat2) such that countOne) displays "ONE., displays 'Two, and G9UOLURg() displays 'Three' 18 nins treading water Don't know how to fly climb a little ne all fight as an stinChar Write a test program (the one with the maintod splay the tollowing: One Three notice there are two fight() method in the list. How do you separate them? Suppose you want the "two fights" associated to their own type, what do you do? (5 points)

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

4. Identify cultural variations in communication style.

Answered: 1 week ago