Question: You are to write a program to simulate a political poll for the upcoming US presidential election. You will prompt the user to enter data

You are to write a program to simulate a political poll for the upcoming US presidential election. You will prompt the user to enter data until they wish to stop. Therefore you will not know how much data will be entered. (You must use dialog boxes for all data input, but you may use System.out statements for your output)
(You must read in at least 5 to 10 sets of data)
The program has been started for you in the file vote.java that is stored with this assignment.
Each set data to read in is:
The gender of the voter (Male, Female)
The age of the voter
The Presidential candidate the voter will choose (Harris, Trump)
You will then print the following statistics for this poll of voters:
1. The Total number of voters
2. Total number of voters for Harris
3. Total number of voters for Trump
4. The Candidate who got the most votes
5. Total number of female voters
6. Total number of male voters
7. Total percent of female voters for Harris
8. Total percent of female voters for Trump
9. Total percent of male voters for Harris
10. Total percent of male voters for Trump
11. Total percent of young (under 25) voters for Harris
12. Total percent of young (under 25) voters for Trump Assignment #5 Java Loop -200 points
Due Date-Oct 3.(nothing accepted late)(Note there are a few extra days for this
assignment)
You are to write a program to simulate a political poll for the upcoming US presidential
election. You will prompt the user to enter data until they wish to stop. Therefore you will
not know how much data will be entered. (You must use dialog boxes for all data input, but
you may use System.out statements for your output)
(You must read in at least 5 to 10 sets of data)
The program has been started for you in the file "vote.java" that is stored with this
assignment.
Each set data to read in is:
The gender of the voter (Male, Female)
The age of the voter
The Presidential candidate the voter will choose (Harris, Trump)
You will then print the following statistics for this poll of voters:
The Total number of voters
Total number of voters for Harris
Total number of voters for Trump
The Candidate who got the most votes
Total number of female voters
Total number of male voters
Total percent of female voters for Harris
Total percent of female voters for Trump
Total percent of male voters for Harris
10.Total percent of male voters for Trump
Total percent of young (under 25) voters for Harris
Total percent of young (under 25) voters for Trump
You are to write a program to simulate a

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 Programming Questions!