Question: Has to be in Java (Bluejay) Class is Animals 1) Polish the class that you proposed as your problem statement. (1.5 points) at least 3

Has to be in Java (Bluejay)

Class is Animals

1) Polish the class that you proposed as your problem statement.

(1.5 points) at least 3 instance variables of different types (e.g., String, int, double, boolean, etc).

(1.5 points) a default constructor that is composed of a sequence of this.set() methods.

(1.5 points) a custom constructor that is composed of a sequence of this.set() methods.

(1.5 points) a get() method for each instance variable

(1.5 points) a set() method for each instance variable. Each set() method uses the this keyword.

(1.5 points) a toString() method

2) Write a Tester for your class that sets up a data set each of whose elements is of your class type. Your tester must meet the following requirements

(1 point) Instantiates an array of a certain size e.g, 10 elements (like in the reference code)

(2 points) Takes user input to populate the array

(2 points) Uses a do-while loop and a switch statement (like we did in a previous lab) to ask the user what they want to do with the data

(6 points @ 1.5 points each) Has at least four options that will correctly handle the users selection when called.

Option 1: Search the array for objects that meet a search criterion. Display the objects if found.

Option 2: Replace an object at a given index with another object.

Option 3: Allow the user to select an element from the array and then modify the element (e.g., select a person from the array of persons and then sets the name of that person to a new value).

Option 4: Sort the array of objects according to a given criterion (e.g., sort the array of persons by height).

Option 5: Exit the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!