Implement a main program that defines a dynamically created array, consisting of objects of class Candidate, and calls three functions:   to. getVotesCandidate: Function that asks the user for the name and votes of the candidate.   b. displayStatistics: function that prints the three columns the name of the candidate, the number of votes obtained and calculates the percentage it represents with respect to the total sum of the votes of the possible candidates.   c.getHighestIndex: Function that returns the index where the highest number of votes obtained among the candidates is stored

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 14PP: (Data processing) Construct a three-dimensional weather array for a two-week time period. Include...
icon
Related questions
Question

Computer Science

Implement a main program that defines a dynamically created array, consisting of objects of class Candidate, and calls three functions:

 

to. getVotesCandidate: Function that asks the user for the name and votes of the candidate.

 

b. displayStatistics: function that prints the three columns the name of the candidate, the number of votes obtained and calculates the percentage it represents with respect to the total sum of the votes of the possible candidates.

 

c.getHighestIndex: Function that returns the index where the highest number of votes obtained among the candidates is stored

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,