Compute the total number of votes received by each candidate

Assignment Help Basic Computer Science
Reference no: EM131674344

Question: 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 121 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 any one 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 candidates should be identified by their letter names.

f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4.

Reference no: EM131674344

Questions Cloud

What circumstance is each tool preferable to the others : Compare and contrast the three tools used in organization assessment (knowledge and skills assessment, job and task analysis, and competency-based assessment).
Creating a work breakdown structure : How would you go about analyzing an organizational structure in terms of creating a work breakdown structure?
Three types of forecasts described in your zybook : Describe and provide an example of three types of forecasts described in your Zybook.
What recommendations would you give to sundar pichai : What recommendations would you give to Sundar Pichai, the CEO of Google, to compete more effectively against Microsoft?
Compute the total number of votes received by each candidate : The results from the mayor's race have been reported by each precinct as follows: Candidate Candidate Candidate Candidate Precinct.
What is the difference between legal and moral obligations : What is the difference between legal and moral obligations? Which do you consider more important?
Discuss innovation and diversification : Discuss International Strategy. Discuss Strategic Implementation. Discuss Innovation and Diversification.
Evaluate major aspects of total quality management : Evaluate major aspects of Total Quality Management
How many coffee cups and portable hard drives they want : Design a program which will calculate the total cost of an order for the three products we sell. The user will be asked how many T-Shirts they want.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd