Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Question 1: (20 marks) a) Write a method that reads candidates information from an input file, an example of which follows: 2 Trump:35:8 Biden:18:26 The

Question 1: (20 marks) a) Write a method that reads candidates information from an input file, an example of which follows: 2 Trump:35:8 Biden:18:26 The first line consists of a number that specifies how many candidates are running for the US presidential election. If that number is n, the next n lines each specify a candidate, with the candidate's name appearing on the line first, followed by a colon, and followed by the number of popular and electoral votes received by that candidate each separated by a colon. Then the method finds and returns the winner information who got the maximum electoral votes. You may assume that the input file will always be properly formatted according to this specification. (10 marks) b) Design and implement a JavaFX GUI which has a text area and a button. When the program starts up, it calls your method in (a) to read and return the winners information in an appropriate format, so once the user clicks the button, it displays the winner who got the maximum electoral votes. (10 marks)

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_2

Step: 3

blur-text-image_3

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

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students explore these related Databases questions