Problem Statement: An election is a formal group decision-making process by which a population chooses a candidate by casting votes. Each candidate is assigned name and a specific symbol. A ballot...


Problem Statement:<br>An election is a formal group decision-making process by which a population chooses a candidate by casting<br>votes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Each<br>ballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol.<br>The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than one<br>symbol. Finally ballot paper has to be dropped in a ballot box.<br>Write a C++ program that reads the information from the user to enter the name of the candidate, the total<br>number of received votes, and the spoilt votes in a local election. The total number of participants (candidates)<br>are 5. If the user mistakenly enters any negative value, the program should consider that value as a positive<br>integer. The program should output the name, total received votes, and the percentage of obtained votes by the<br>winning candidate. The program should also display the percentage of the spoilt votes.<br>Note: Use repetition and selection structures<br>Sample Output:<br>CAWindows\system32\cmd.exe<br>Electoral System Summary<br>**************<br>******<br>Enter first name, obtained votes of candidate<br>1. Ali<br>2. Asma<br>3. Khoula<br>4. Ahmed<br>5. Mohammed<br>Enter Spoilt votes : 23<br>The winner is Mohammed who obtained 987 votes out of 2945, which is 34% of total votes.<br>The total number of spoilt votes are 23, which is 0.78% of total votes.<br>Press any key to continue<br>437<br>398<br>400<br>700<br>987<br>

Extracted text: Problem Statement: An election is a formal group decision-making process by which a population chooses a candidate by casting votes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Each ballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol. The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than one symbol. Finally ballot paper has to be dropped in a ballot box. Write a C++ program that reads the information from the user to enter the name of the candidate, the total number of received votes, and the spoilt votes in a local election. The total number of participants (candidates) are 5. If the user mistakenly enters any negative value, the program should consider that value as a positive integer. The program should output the name, total received votes, and the percentage of obtained votes by the winning candidate. The program should also display the percentage of the spoilt votes. Note: Use repetition and selection structures Sample Output: CAWindows\system32\cmd.exe Electoral System Summary ************** ****** Enter first name, obtained votes of candidate 1. Ali 2. Asma 3. Khoula 4. Ahmed 5. Mohammed Enter Spoilt votes : 23 The winner is Mohammed who obtained 987 votes out of 2945, which is 34% of total votes. The total number of spoilt votes are 23, which is 0.78% of total votes. Press any key to continue 437 398 400 700 987
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here