DESCRIPTIONS OF PROBLEM: Voting Machine - A college would like to make an automatic voting system. The system will receive 3 candidate's names and displays the name to the voters. Then each voter should enter one choice at a time 1, 2 or 3 subject to the number of candidates respectively. The system will calculate all choices made and will list up the result at the end of the voting session. Prior exit the system will display the result in a bar graph. SAMPLE OF OUTPUT: Enter candidates name (Ctrl-Z to end input candidates): Candidate 1 Manal Candidate 2 Khadijah Candidate 3: Wafa *z. End entering candidate Begin voting.. Time start: 12:00:00 (1) Manal: 0 Your choice: (2) Khadijah:0 (3) Wafa:0 3 Next vote (y/n): y (1) Manal: 0 (2) Khadijah:0 (3) Wafa:1 Your choice: 3 Next vote (y/n) : y (1) Manal: 0 (2) Khadijah:0 4 - invalid choice (3) Wafa:2 Your choice: (1) Manal:0 Your choice: 3 (2) Khadijah:0 (3) Wafa:2 Next vote (y/n): Y (1) Manal: 0 (2) Khadijah:0 (3) Wafa:3 Your choice: 2 Next vote (y/n): Y (1) Manal: 0 Your choice: (2) Khadijah:1 2. (3) Wafa:3 Next vote (y/n): n (1) Manal: 0 (2) Khadijah:2 (3) Wafa:3 End Voting Session Time: 12:30:02 Final Result for Voting 1- Manal I 2- Khadijah 3- Manal Total voters: 5

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question
Java
DESCRIPTIONS OF PROBLEM:
Voting Machine - A college would like to make an automatic voting system. The system will
receive 3 candidate's names and displays the name to the voters. Then each voter should enter
one choice at a time 1, 2 or 3 subject to the number of candidates respectively. The system will
calculate all choices made and will list up the result at the end of the voting session. Prior exit
the system will display the result in a bar graph.
SAMPLE OF OUTPUT:
Enter candidates name (Ctrl-Z to end input candidates):
Candidate 1 Manal
Candidate 2 Khadijah
Candidate 3 Wafa
*z. End entering candidate
Begin voting..
Time start: 12:00:00
(1) Manal: 0
Your choice:
(2) Khadijah:0
3
(3) Wafa:0
Next vote (y/n): y
(1) Manal: 0
(2) Khadijah:0
(3) Wafa:1
Your choice:
Next vote (y/n): y
(1) Manal: 0
(2) Khadijah:0
4 invalid choice
(3) Wafa:2
Your choice:
(1) Manal: 0
Your choice: 3
(2) Khadijah:0
(3) Wafa:2
Next vote (y/n): y
(1) Manal: 0
(2) Khadijah:0
(3) Wafa:3
Your choice:
Next vote (y/n): y
(1) Manal:0
Your choice:
(2) Khadijah:1
(3) Wafa:3
Next vote (y/n): n
(1) Manal: 0
(2) Khadijah:2
(3) Wafa:3
End Voting Session Time: 12:30:02
Final Result for Voting
1- Manal I
2- Khadijah
3- Manal
1***
Total voters: 5
Transcribed Image Text:DESCRIPTIONS OF PROBLEM: Voting Machine - A college would like to make an automatic voting system. The system will receive 3 candidate's names and displays the name to the voters. Then each voter should enter one choice at a time 1, 2 or 3 subject to the number of candidates respectively. The system will calculate all choices made and will list up the result at the end of the voting session. Prior exit the system will display the result in a bar graph. SAMPLE OF OUTPUT: Enter candidates name (Ctrl-Z to end input candidates): Candidate 1 Manal Candidate 2 Khadijah Candidate 3 Wafa *z. End entering candidate Begin voting.. Time start: 12:00:00 (1) Manal: 0 Your choice: (2) Khadijah:0 3 (3) Wafa:0 Next vote (y/n): y (1) Manal: 0 (2) Khadijah:0 (3) Wafa:1 Your choice: Next vote (y/n): y (1) Manal: 0 (2) Khadijah:0 4 invalid choice (3) Wafa:2 Your choice: (1) Manal: 0 Your choice: 3 (2) Khadijah:0 (3) Wafa:2 Next vote (y/n): y (1) Manal: 0 (2) Khadijah:0 (3) Wafa:3 Your choice: Next vote (y/n): y (1) Manal:0 Your choice: (2) Khadijah:1 (3) Wafa:3 Next vote (y/n): n (1) Manal: 0 (2) Khadijah:2 (3) Wafa:3 End Voting Session Time: 12:30:02 Final Result for Voting 1- Manal I 2- Khadijah 3- Manal 1*** Total voters: 5
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning