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: Electoral System Summary ....... ........ Enter first name, obtained votes of candidate 1. Ali 2. Asma 437 398 3. Khoula 400 4. Ahmed 700 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 987 ...

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%
Read problem carefully.
Solve problem using 5-steps of Engineering Problem Solving Methodology (including algorithm) in
MS-Word file save it as your id (123456).
Draw flowchart diagram in MS-Visio (or any other software) and save it as an image file using your id
(123456).
• Write a C++ program and save it as C++ (.cpp) file using your id (123456).
• Place above three files in a folder and save it as your id (123456) then compress it and upload on the
given link for submission of homework 2 in the Moodle.
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:
CWindowayeondee
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
Transcribed Image Text:Read problem carefully. Solve problem using 5-steps of Engineering Problem Solving Methodology (including algorithm) in MS-Word file save it as your id (123456). Draw flowchart diagram in MS-Visio (or any other software) and save it as an image file using your id (123456). • Write a C++ program and save it as C++ (.cpp) file using your id (123456). • Place above three files in a folder and save it as your id (123456) then compress it and upload on the given link for submission of homework 2 in the Moodle. 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: CWindowayeondee 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
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education