Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1: Imagine that you want to keep track of your pet fish. Each fish is a certain kind and has a two-part name. For example,

Q1: Imagine that you want to keep track of your pet fish. Each fish is a certain kind and has a two-part name. For example, your clownfish is named Nemo Finding. You want to see whether any two given fish are the same kind. You also want to know how many fish you have. Design, implement, and demonstrate a class Fish that meets the previous requirements. Include UML diagram that gives only the class names and the associations between them. Document each method with comments in javadoc format. Implement a class called Name to represent a fishs pet name. Some of your methods and constructors must have object parameter of type class. SAMPLE OUTPUT: Test toString(): Nemo Finding (clownfish) Test getName(), getType(), and getNumberOfFish(): My name is Nemo Finding; I am a clownfish fish. There are 3 fish in the tank. Test isSameType(): Nemo Finding (clownfish) and Bozo Iron (clownfish) are the same type of fish. Nemo Finding (clownfish) and Patrick Star (starfish) are different types of fish. Press any key to continue . . .

//please finish this in javaimage text in transcribed

Q1: Imagine that you want to keep track of your pet fish. Each fish is a certain kind and has a two-part name. For example, your clownfish is named Nemo Finding. You want to see whether any two given fish are the same kind. You also want to know how many fish you have. Design, implement, and demonstrate a class Fish that meets the previous requirements. Include UML diagram that gives only the class names and the associations between them. Document each method with comments in javadoc format. Implement a class called Name to represent a fish's pet name. Some of your methods and constructors must have object parameter of type class. SAMPLE OUTPUT: Test toString () : Nemo Finding (clownfish) Test getName(), getType(), and getNumberOfFish(): My name is Nemo Finding; I am a clownfish fish. There are 3 fish in the tank. Test isSameType () : Nemo Finding (clownfish) and Bozo Iron (clownfish) are the same type of fish. Nemo Finding (clownfish) and Patrick Star (starfish) are different types of fish. Press any key to continue

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

What are some sources of ethical guidance?

Answered: 1 week ago