Question: The Program should be in C++ and it should follow all the requirement down below. thank you Documentation (10%) program file name brief description of

 The Program should be in C++ and it should follow all The Program should be in C++ and it should follow all the requirement down below. thank you

Documentation (10%)

program file name

brief description of assignment

name of the author

course title and meeting time

assignment number and due date

each function has a brief description

Formatting (10%)

Use proper indentation in main function

Use proper indentation in if /switch statements

Use proper indentation in while/do-while/for statements

Use proper indentation for function declarations

Technique (40%)

Identifiers have meaningful names

Appropriate variable declarations (no global variables)

Function for reading the candidate names and votes into parallel arrays

Function to calculate the percentage of votes for each candidate and store in an array

Function to determine the winner

Function to display the results (candidate names, votes received, % of votes, total votes and the name of the winner)

Main function consists of only function calls NOTE: there should be no loops or if statements in the main

Output (40%)

Calculations are correct

Program runs without modification

Output displays the candidates' names, votes received and percent of votes

Output displays the total number of votes

Output displays the name of the winning candidate

Write a program that allows the user to enter the last names of five candidates in a local election and the number of votes received by each candidate. The program should then output each candidate's name, the number of votes received, and the percentage of the total votes received by the candidate. Your program should also output the win- ner of the election. A sample output is: % of Total votes Candidate Votes Received 25.91 5000 Johnson 20.73 4000 Miller 31.09 6000 Duffy 2500 Robinson 9.33 1800 Ashtony 19300 Total The winner of the election is Duffy. 12.95

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!