Question: Java BagList ADT. Write an example class by writing / completing all the methods in the photo. Use an ArrayList to hold raffle entry objects.

Java BagList ADT. Write an example class by writing / completing all the methods in the photo. Use an ArrayList to hold raffle entry objects. Guaranteed thumbs up.

Java BagList ADT. Write an example class by writing / completing all

1. A constructor taking a single String parameter denoting the pathname to a file with which to seed the raffle with a number of entries. It DOES NOT throw any type of exception. public Raffle(String filePathName) The contents of the file are last name, first name and id, all of one line and separated by whitespace. A second no argument constructor that creates an empty raffle. 2. An addEntry method that adds a single Entry object to the raffle. Duplicate entries are not permitted (see item 5 below). public boolean addEntry(Entry entry) 3. A combine method that adds all the Entry objects in one raffle to this raffle. Duplicate entries (see below) are not permitted and should be ignored. public void combine(Raffle other) 4. An pickWinners method that returns a List of winning entries. Winning entries are chosen at random and removed from the Raffle collection. public List pickWinners(int numberOfWinners) 5. The Entry class shall have a constructor defined as follows: public Entry(String firstName, String lastName, String entrySN) The entrySN parameter is the 'serial number for the raffle entry. No two are alike. 1. A constructor taking a single String parameter denoting the pathname to a file with which to seed the raffle with a number of entries. It DOES NOT throw any type of exception. public Raffle(String filePathName) The contents of the file are last name, first name and id, all of one line and separated by whitespace. A second no argument constructor that creates an empty raffle. 2. An addEntry method that adds a single Entry object to the raffle. Duplicate entries are not permitted (see item 5 below). public boolean addEntry(Entry entry) 3. A combine method that adds all the Entry objects in one raffle to this raffle. Duplicate entries (see below) are not permitted and should be ignored. public void combine(Raffle other) 4. An pickWinners method that returns a List of winning entries. Winning entries are chosen at random and removed from the Raffle collection. public List pickWinners(int numberOfWinners) 5. The Entry class shall have a constructor defined as follows: public Entry(String firstName, String lastName, String entrySN) The entrySN parameter is the 'serial number for the raffle entry. No two are alike

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!