Question: c + + Skills Needed: This machine problem will cover Vectors. NOTE: You must design your own Vector class to solve the problem. You are

c++
Skills Needed: This machine problem will cover Vectors.
NOTE: You must design your own Vector class to solve the problem. You are not allowed to use provided with C++.
Purpose: Write a program to create miniVector so you can solve the following:
For this assignment, you will take the results of a recent election in a small city and report the results in different formats. Remember using is not allowed.
First, you must read the results from a data file and store the values using vectors. The file has the last name of each candidate and the number of votes received on one line. There could be any number of lines in the file so the program needs to count them as it goes.
Finally, you must print the results arranged in order from the winner down to the person with the fewest votes. The report should include only the name of each candidate, the total votes received by that candidate and the percentage of the votes cast in the election for that candidate arranged in order from largest to smallest. Print the percentages with one decimal place.
Create the data file using the following records and put it into the project folder, name the file "votes.txt":
Candidate Votes
Lincoln 5000
Parks 2000
Shakespeare 8000
Ghandi 2500
Ashe 1750
A Sa jmple output will be sent to an output file called "votePctOutput.txt" is as follows:
Candidate Votes Received % Votes
xxxxxxxxxxxx xxxx xx.x
xxxxxxxxxxxx xxxx xx.x
xxxxxxxxxxxx xxxx xx.x
Do not use

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!