[Solved]Java Make Sure Extra Credit Program Aswell Q37122951
in Java and make sure the extra credit is in the programaswell

Submission Instructions Submit by midnight on the due date and include your submission (a zip file) as an attachment. Assignment Design a class named Animal. An Animal object has the following data members: name (String), age (integer), amount-food-eaten-per-day (integer, representing ounces) and a preferred food (String). Create a toStringO method in the Animal class. Create a no-arg constructor method that sets default values to the 4 data members as follows name- ‘”unknown age 0 amount-0 food “none In a separate java file create another class with a main method. In the main method perform the following processing: Create an array of 15 Animal objects. Initialize the array of Animal objects with random data as follows name – will be one from “Rhino”, “Deer”, “Snake, “Elephant”, “Cat” age – will be from 2-15 amount – will be from 5-50 food – will be one from “Grass”, “Oats”, “Fish”. “Meat” Sort the array of Animal objects in order of age Print the array using the toString0 method in the Animal class, one Animal per line (15 total lines of output) Print the total cost per day to feed all Rhino’s (1 line of output). Print the total cost per day to feed all Deer (1 line of output) Print the total cost per day to feed all Snakes (1 line of output) Print the total cost per day to feed all Cats (1 line of output) An example of the above output (for Cats) is The total cost to feed Cats per day is S34 The cost to feed an animal per day is the amount of food eaten per day multiplied by the cost of the food the animal eats. Food costs, in dollars, are Grass 1 Oats 2 Fish-5 Meat 8 Extra Credit (10%) Find and print the animal that is the most expensive to feed. Show transcribed image text Submission Instructions Submit by midnight on the due date and include your submission (a zip file) as an attachment. Assignment Design a class named Animal. An Animal object has the following data members: name (String), age (integer), amount-food-eaten-per-day (integer, representing ounces) and a preferred food (String). Create a toStringO method in the Animal class. Create a no-arg constructor method that sets default values to the 4 data members as follows name- ‘”unknown age 0 amount-0 food “none In a separate java file create another class with a main method. In the main method perform the following processing: Create an array of 15 Animal objects. Initialize the array of Animal objects with random data as follows name – will be one from “Rhino”, “Deer”, “Snake, “Elephant”, “Cat” age – will be from 2-15 amount – will be from 5-50 food – will be one from “Grass”, “Oats”, “Fish”. “Meat” Sort the array of Animal objects in order of age Print the array using the toString0 method in the Animal class, one Animal per line (15 total lines of output) Print the total cost per day to feed all Rhino’s (1 line of output). Print the total cost per day to feed all Deer (1 line of output) Print the total cost per day to feed all Snakes (1 line of output) Print the total cost per day to feed all Cats (1 line of output) An example of the above output (for Cats) is The total cost to feed Cats per day is S34 The cost to feed an animal per day is the amount of food eaten per day multiplied by the cost of the food the animal eats. Food costs, in dollars, are Grass 1 Oats 2 Fish-5 Meat 8 Extra Credit (10%) Find and print the animal that is the most expensive to feed.
Expert Answer
Answer to in Java and make sure the extra credit is in the program aswell… . . .
OR

