Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone please help me with My AP CSA Lab. Here is the instruction: This project is intended to give you some freedom to create

Can someone please help me with My AP CSA Lab.

Here is the instruction:

This project is intended to give you some freedom to create a useful program, but to also have to demonstrate the inheritance knowledge you have acquired in the course.

### Create a superclass. - It must have at least 2 instance variables - It must have a default constructor, and at least one parameter constructor. - It must have the appropriate accessors, modifiers, toString() and equals() methods. - It must have at least 2 other "interesting" methods

### Create a subclass to the one above. - It must have at least one of its' own instance variables - It must have a default constructor, parameter constructor, and the appropriate accessor and modifier methods. The constructors must have explicit calls to the parent constructor using super. - It must override and implement one of the methods of its parent. This method may or may not use the super keyword. - It must override the toString() and equals() methods and use a call to the super's method. - It must have at least two unique, non-inherited methods.

### Create another subclass to the one above. - It must have at least one of its' own instance variables - It must have a default constructor, parameter constructor, and the appropriate accessor and modifier methods. The constructors must have explicit calls to the parent constructor using super. - It must override and implement one of the methods of its parent. This method may or maynot use the super keyword. - It must override the toString() and equals() methods and use a call to the super's method. - It must have at least two unique, non-inherited methods.

### Create a "tester" class with a main method - Create an ArrayList of superclass objects - Create 10 objects and add them to your ArrayList. They should include all 3 objects you have created above. - At least 5 of the examples must demonstrate proper aliasing and/or cloaking.

### Sample Output in Main ``` WalkingZombie is a subclass of Zombie which is a subclass of Monster.

ArrayList listOfMonsters = new ArrayList(); Monster m1 = new Monster(); Monster m2 = new Zombie(); //cloaking example Monster m3 = new WalkingZombie(); //cloaking example Monster m4 = m3; //aliasing example listOfMonsters.add(m1); listOfMonsters.add(m2); listOfMonsters.add(m3); listOfMonsters.add(m4); ``` The above example creates 4 objects and adds them to the ArrayList.

#### After your code is complete: - Create 5 multiple choice questions using your examples - Create 5 multiple choice questions, similar to what would be on a test. You will create the questions and the choices. Also, indicate what the correct answer is. - Look back at previous homework assignments for examples on how to set up the multiple choice problems

And here is the starter code:

class Main { public static void main(String[] args) { //your code here } }

Please help me finish this lab. Thank you so much!

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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions