The voting results from the student body representative race has been reported by each faculty as tabled below : Candidate A 192 Candidate B Candidate C Candidate D Faculty 1 Faculty 2 Faculty 3 Faculty 4 Faculty 5 48 90 206 312 37 21 147 186 12 121 38 114 267 21 13 408 382 39 29 Write a program to do the following: a. Display the table with appropriate labels for rows and columns Create function to do this : void printArray(int arr[]) b. Compute and display the total number of votes received by each candidate and the percentage of the total votes casts Store total number of votes received by each candidate in an array: int candidateVotes[]; Store percentage of votes received in another array: double candidateVotesPercent[]; c. (1) If any one candidate received 50% of the votes, the program should display a message decdaring that the candidate is the winner. (i)If no candidate received 50% of the votes, the program should display a message showing the top 2 candidates with the most number of votes. Create a function to perform the announcement of winners based on votes percentage: void announceWinner(double candidatesVotesPercent[]) d. Run the program with the data shown above and run once more using the data below |Candidate A 192 Candidate B 48 Candidate C 206 |Candidate D 37 Faculty 1 Faculty 2 Faculty 3 Faculty 4 Faculty 5 147 90 312 21 186 114 12 21 121 108 38 39 267 13 382 29
The voting results from the student body representative race has been reported by each faculty as tabled below : Candidate A 192 Candidate B Candidate C Candidate D Faculty 1 Faculty 2 Faculty 3 Faculty 4 Faculty 5 48 90 206 312 37 21 147 186 12 121 38 114 267 21 13 408 382 39 29 Write a program to do the following: a. Display the table with appropriate labels for rows and columns Create function to do this : void printArray(int arr[]) b. Compute and display the total number of votes received by each candidate and the percentage of the total votes casts Store total number of votes received by each candidate in an array: int candidateVotes[]; Store percentage of votes received in another array: double candidateVotesPercent[]; c. (1) If any one candidate received 50% of the votes, the program should display a message decdaring that the candidate is the winner. (i)If no candidate received 50% of the votes, the program should display a message showing the top 2 candidates with the most number of votes. Create a function to perform the announcement of winners based on votes percentage: void announceWinner(double candidatesVotesPercent[]) d. Run the program with the data shown above and run once more using the data below |Candidate A 192 Candidate B 48 Candidate C 206 |Candidate D 37 Faculty 1 Faculty 2 Faculty 3 Faculty 4 Faculty 5 147 90 312 21 186 114 12 21 121 108 38 39 267 13 382 29
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
Related questions
Question
100%
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education