Question: This experiment is designed to develop confidence with arrays and reading files. The experiment focuses upon the material on arrays covered in the text and
This experiment is designed to develop confidence with arrays and reading files. The experiment focuses upon the material on arrays covered in the text and in lecture. A text file including the statistic of a vote is provided. Write a program which has three arrays: candidates, votes, and percent's. They should be declared as string, int and double respectively. Your program should read the candidates.txt file into arrays, analyze the data, and display the results. Your program must use a function to read the file candidates. txt into candidates and votes arrays. A second function then determines the total number of votes and calculate the percentage of each candidates and fill the percent's array. Then it passes all three arrays to a function which will print the names of the candidates, their vote totals and percentages, and the election results using the provided format, e.g
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
