2 Given the following Contestant class and Queue class ADT's. public class Contestant private int contestant ID: private
Posted: Fri Jul 01, 2022 5:34 am
2 Given the following Contestant class and Queue class ADT's. public class Contestant private int contestant ID: private String contestantName: private char contestant Gender: //F-Female or M-Male private double contestant Weight: //contestant's weight in kg Contestant (...) {-} public int getContestantID () () public String getContestantName() () public char getContestant Gender () () public double getContestantWeight () () //definition of other methods }//end of class Contestant public class Queue ( public void enqueue (Object item) [..] public Object dequeue () (-) public boolean isEmpty() //other definition 1 // end of Queue class Write program segments to solve the following problems, assume that you have declared a queue name biggest Loser and inputted data of 50 contestants. Remove all contestants which have weight more than 150 kg from the queue biggest Loser and store them into other queue named overweight. Remain the original order of biggest Loser. (5 marks) b) Separate male and female contestants into two different queues named maleContestant and femaleContestant respectively. (5 marks) c) Display the name and weight of the winner of male category from maleContestant queue Contestant who has the smallest weight is the winner of the contestant. (5 marks)