Question: Purpose: This experiment is designed to develop confidence with arrays and reading files. Readings: The experiment focuses upon the material on arrays covered in the

Purpose:
This experiment is designed to develop confidence with arrays and reading files.
Readings:
The experiment focuses upon the material on arrays covered in the text and in module.
Instructions:
Write a c++
\table[[Graham,13048,6.6%program which has three arrays: candidates, votes and percents. They should be declared as string, int and double respectively and all should be of size 25. Your program should use a function to read the file candidates. txt into the array, candidates. The file is on Canvas in this week's module under Materials. The program should then pass the votes array to a function which will generate random numbers between 1500 and 25000(cf page 128 in the text) to fill the votes array. A third function (to which you will pass the votes and percents arrays) will determine the total number of votes for all candidates and then calculate the percentage for each candidate and fill the percents array. Then pass all three arrays to a function which will print the names of the candidates, their vote totals and percentages and print out the election results, eg:
\table[[Candidate,Votes,Percent],[Rubio,8905,4.5%
Purpose: This experiment is designed to develop

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 Finance Questions!