Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

how do I solve this in java ? population. The winner of each congressional district (CD) is awarded one electoral vote, and the winner of

how do I solve this in java ? image text in transcribed
population. The winner of each congressional district (CD) is awarded one electoral vote, and the winner of the state-wide vote is then awarded the state's remaining two electoral votes. In US election 2020, a vote for the Presidential candidate is for either Trump or Biden. a) Design and implement Java classes to represent the following: 1. Candidate: each object of which represents one candidate, consisting of a name, and the number of electoral and popular votes received by that candidate so far. (7 marks) 2. Using Java Comparator interface, implement necessary classes in order to compare candidate objects on the basis of the data members; the number popular votes or the electoral votes. This would help you to find Collections.max() either based on popular votes or electoral votes. (6 marks: 3 marks for each comparison class) 3. State: each object of which represents one state, consisting of the number of electoral votes allocated for that state, list of candidates and the state certified winner. (10 marks) 4. WTA State: each object of which represents one state type that implements WTA method and it consists of an ArrayList of votes. Each vote consist of a name of the presidential candidate for US. (In 2020 presidential election, votes are for either "Trump" or "Biden"). (3 marks) 5. CDP State: each object of which represents one state type that implements CDP method and it consists of an ArrayList of votes for each CD. (3 marks) Note: In each class, implement constructors and appropriate accessor and mutator methods

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DNA Databases

Authors: Stefan Kiesbye

1st Edition

0737758910, 978-0737758917

More Books

Students also viewed these Databases questions