Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import java.util.scanner; import java.util.List; import java.util.ArrayList; import java.util.collections; import static java.lang.System.* public class Toystore private ArrayList Toy> toyList; public ToyStore () public void loadToys( String
import java.util.scanner; import java.util.List; import java.util.ArrayList; import java.util.collections; import static java.lang.System.* public class Toystore private ArrayList Toy> toyList; public ToyStore () public void loadToys( String toys) public Toy getThatToy String nm ) return null; public String getMostFrequentToy() return public void sortToysBycount () public String tostring) return ""; import java.util.Scanner; import java.util.ArrayList; import java.util.Collections; import static java.lang.System.* public class ToyStoreRunner public static void main( String args[]) Lab Description: particular toy occurs. Create a program that will store a list of Toys and keep track of how many times a BONUS +10 POINTS - Write a method to return the Toy that occurs in the list most frequent and another method to sort the toys by count. Sample Data sorry bat sory SOKEY SOE train txaia teddy ddy bal1 bal Files Needed Toy. java ToyStore.java ToyStoreRunner.java Sample Output sorry 4, bat 1, train 2, teddy 2, ball 2] maxsorry import static java. lang.System. public class Toy private String name; private int count; public Toy public Toy( String nm) public int getcount () return 0; public void setCount int cnt) public string getName return null; public void setName String nm public String tostring) return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started