Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q.4. An election is contested by 3 candidates and the candidates are numbered from 1 to 3. The voting is done by marking the candidate
Q.4. An election is contested by 3 candidates and the candidates are numbered from 1 to 3. The voting is done by marking the candidate number on the ballot paper. Write a program in R to i) cast the vote for user supplied n voters, and to ii) read the ballots and count the votes for each candidate. In case a number read is outside the range of 1 to 3, the ballot should be considered as a 'spoilt ballot and the program should also count the number of spoilt ballots. [5]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started