The results from the mayor's race have been reported

Question # 00639651
Subject: Education
Due on: 09/27/2022
Posted On: 09/27/2022 04:50 AM
Tutorials: 1
Rating:
4.9/5
Question Dot Image

The results from the mayor's race have been reported by each precinct and you are to design and write a class called VotingResults to tabulate and display results. It should have at least the following methods:
A method displayReport to print out the table of votes as seen below.
A method displayTotals to compute and print the total number of votes received by each candidate.
A method displayWinner to determine the winning candidate, if any. If a candidate received over 50% of the votes, the method should print a message declaring that candidate is the winner. If no candidate received over 50% of the votes, the program should print a message declaring that a run-off must occur.

A constructor that takes a data file (as a Scanner object) filled with data to use for the class variables. It invokes computeTotals, which computes the total votes per candidate (so displayWinner will have accurate results).
 

The data is set up as follows:

First line of data – the number of candidates and number of precincts

Then one candidate name (one String) per line

Next bunch of lines of data – integers with number of votes for each candidate per precinct respectively

Sample data:

4 5

ANDERSON

BAKER

JONES

WHITE

192 147 186 114 267
48 90 12 21 13
206 312 121 408 382
37 21 38 39 29
Sample output from some client program invoking displayReport, displayTotals, and displayWinner:

PRECINCT ANDERSON BAKER JONES WHITE
1 192 48 206 37
2 147 90 312 21
3 186 12 121 38
4 114 21 408 39
5 267 13 382 29

TOTALS 906 184 1429 164
THE WINNER IS JONES
Start writing this class by determining the necessary instance variables. Then write the constructor. Finally, write the other methods.

Dot Image
Getsolution Posted By :
Questions: 15530 Tutorials: 15529
Tutorials for this Question

The results from the mayor's race have been reported

Tutorial # 00638532
Posted On: 09/27/2022 04:51 AM
Feedback Score: Not rated yet!
Purchased By: 2
Getsolution
Posted By:
Questions:
15530
Tutorials:
15529
Report this Tutorial as Inappropriate
Tutorial Preview
The solution of The results from the mayor's race have been reported...
Attachments
The_results_from_the_mayors_race_have_been_reported.ZIP (18.96 KB)

Great! We have found the solution of this question!

Related Questions
Art Piece -Think Critically about Current Events
1) Art Piece Creative Art Piece (Presentation)-  You will create an art piece about a social psychological challenge.  Think Critically about Current Events: Application of Sociol …
HUS4352 Lesson 15 Discussion - Why do you think the man was able
HUS4352 Multicultural Lesson 15 Discussion   Why do you think the man was able to change his opinion about Muslim refugees? What intervention would you recommend to help people see …
Imagine you are a program manager for a local youth center
University of Phoenix presentation technology impact theories Imagine you are a program manager for a local youth center. You are creating a presentation for parents to learn about how people inter …
We encounter research information in many different places
Individual HW 1 - Do you Believe it? Question #1: We encounter research information in many different places, but one of the most common places is on social media. For this question, please find …
HUS483 Discussion - Reflect on the professional competencies
HUS 483 CAPSTONE PROJECT Demonstrating Professional Competencies: Discussion Question: Reflect on the professional competencies needed for effective practice in mental health and human services. …
US Federal wetland policy since the Bush era has been
wetland policy review 1. US Federal wetland policy since the Bush era has been "No Net Loss". What does that mean? 2. What is mitigation banking? What role does it play in "No Net …
Engineering Design - Differentiate between design period
Engineering Design Questions a. Differentiate between design period and life expectancy of a project b. Distinguish between pretreatment, primary treatment, secondary treatment, and tertiary …
Cyber Security Discussion - identifying how the Cloud Architecture
National University Cyber Security Discussion Prepare a full two-essay (double-spaced, APA format) identifying how the Cloud Architecture and Design Principles can be combined with the AWS Platform …
Creative Brief Essay - Part 1,2 - Advertising Brief, Using what you have learned
California National University National University Creative Brief Essay Quest 3: Part 1 of Advertising Brief In Week 3, you will create an Advertising Brief and you will do a peer review of your …
Based on information covered in the lectures
National University Kubernetes Discussion Based on information covered in the lectures, define and explain what Kubernetes is and how you believe Kubernetes will be beneficial to a business environ …
Recent Questions
assignment help
Students may work alone or in groups of two to three or alone. Students may not work with classmates from another section; you must work within your section with the same clinical instructor.&nbs …
Is that worth to work with A1 All Tech Professional Services ?
A1 All Tech Professional Services is a trusted name in New Jersey for residential and commercial property improvement, offering expert craftsmanship in best general contracting company in Newark NJ, r …
regis college nu641 exam
any exam questions …
Walden HLTH6412 Complete Course Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 1 Discussion EVIDENCE BASED RESOURCES You have probably heard of evidence-based medicine, but have you heard of evidenc …
Walden HLTH6412 All Assignments Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 1 Assignment DISTINGUISHING RELIABLE SOURCES OF INFORMATION Ensuring that you utilize reliable health information to in …
Walden HLTH6412 Module 6 Assignment Latest 2025
HLTH6412 Health Ed & Comm. Strategies Module 6 Assignment FINAL PROJECT Each day the public is exposed to many different forms of health communication. Health communications and the healt …
Walden HLTH6412 Module 5 Assignment 3 Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 5 Assignment 3 INFOGRAPHIC FOR HEALTH EDUCATION TO E-LEARNING Keeping in mind the knowledge you gained from completing …
Walden HLTH6412 Module 5 Assignment 2 Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 5 Assignment 2 INTRODUCTION TO DATA STORYTELLING WITH INFOGRAPHIC This assignment explores how much an infographic can …
Walden HLTH6412 Module 5 Assignment 1 Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 5 Assignment 1 USING ARTIFICIAL INTELLIGENCE IN HEALTH EDUCATION It may be difficult to believe that the term Artificia …
Walden HLTH6412 Module 3 Assignment 2 Latest 2025
HLTH6412-1/HLTH8412E-1/HLTH5412 Health Ed & Comm. Strategies Module 3 Assignment 2 ASSESSING CULTURAL COMPETENCE Being a culturally competent health educator can help reduce the health eq …