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
tableGrahamprogram which has three arrays: candidates, votes and percents. They should be declared as string, int and double respectively and all should be of size 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 and cf page 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:
tableCandidateVotes,PercentRubio
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
