Write a Program in C To Display the Table with Appropriate Headings for the Rows and Columns



Write a Program in C To Display the Table with Appropriate Headings for the Rows and Columns

The results from the mayor's race have been reported by each precinct as follows:

-----> Candidate ---- Candidate ---- Candidate ---- Candidate.
Precinct ---- A ---- B ---- C ---- D
1 ---- 192 ---- 48 ---- 206 ---- 37
2 ---- 147 ---- 90 ---- 312 ---- 21
3 ---- 186 ---- 12 ---- 21 ---- 38
4 ---- 114 ---- 21 ---- 408 ---- 39
5 ---- 267 ---- 13 ---- 382 ---- 29

Write a program to do the following:

a. Read the raw vote totals from a data file that contains one row for each precinct.
b. Display the table with appropriate headings for the rows and columns.
c. Compute and display the total number of votes received by each candidate and the percent of the total Votes cast.
d. If anyone candidate received over 50% of the votes, the program should print a message declaring that candidate the winner.
e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two

Asked by: Saitej on Sep 10, 2019.

Be the first to answer this Question !

Your Answer :

Name *:

Email *: (Required but will not be displayed)

» Your answers will be displayed only after manual approval.

Related Questions


No related questions found for this page.

Sponsored Links


Current Affairs

Quick Links