Make flow chart 12 3456789 10 11 12 13 14 15 18 19 20 21 22 23
Fantastic news! We've Found the answer you've been seeking!
Question:
Make flow chart
Transcribed Image Text:
12 3456789 10 11 12 13 14 15 18 19 20 21 22 23 24 25 26 27 28 29 30 def election_results(): # Ask for the number of candidates participating in the election num_candidates = int (input("Enter the number of candidates participating in the election: ")) 16 + 1)))) 17 33 34 # Make sure the number of candidates entered by the user is 1 or more while num_candidates < 1: num_candidates = int(input("Please enter a number of candidates of 1 or more: ")) # Create two arrays to store the names and votes of the candidates candidates = [] votes = [] 35 36 if 37 # Ask the user to enter the names and votes of the candidates for i in range(num_candidates) : candidates.append(input ("Enter the last name of candidate {}: ".format(i + 1))) votes.append(int (input("Enter the number of votes received by candidate {}: ".format(i # Calculate the total number of votes casted total_votes = sum(votes) # Display the heading "ELECTIONRESULTS" print("ELECTIONRESULTS") # Display the name and number of votes, one per line for i in range(num_candidates) : print("{}: {} votes". format (candidates [i], votes[i])) # Calculate and display the percentage of the total votes stored in an array received by 31 the candidate 32 for i in range(num_candidates): percentage = votes [i] / total_votes * 100 print("{}: {}%".format(candidates [i], percentage)) # Display the heading "ELECTIONRESULTS BY PERCENTAGE" print("ELECTIONRESULTS BY PERCENTAGE") name 11 _main___": election_results() 12 3456789 10 11 12 13 14 15 18 19 20 21 22 23 24 25 26 27 28 29 30 def election_results(): # Ask for the number of candidates participating in the election num_candidates = int (input("Enter the number of candidates participating in the election: ")) 16 + 1)))) 17 33 34 # Make sure the number of candidates entered by the user is 1 or more while num_candidates < 1: num_candidates = int(input("Please enter a number of candidates of 1 or more: ")) # Create two arrays to store the names and votes of the candidates candidates = [] votes = [] 35 36 if 37 # Ask the user to enter the names and votes of the candidates for i in range(num_candidates) : candidates.append(input ("Enter the last name of candidate {}: ".format(i + 1))) votes.append(int (input("Enter the number of votes received by candidate {}: ".format(i # Calculate the total number of votes casted total_votes = sum(votes) # Display the heading "ELECTIONRESULTS" print("ELECTIONRESULTS") # Display the name and number of votes, one per line for i in range(num_candidates) : print("{}: {} votes". format (candidates [i], votes[i])) # Calculate and display the percentage of the total votes stored in an array received by 31 the candidate 32 for i in range(num_candidates): percentage = votes [i] / total_votes * 100 print("{}: {}%".format(candidates [i], percentage)) # Display the heading "ELECTIONRESULTS BY PERCENTAGE" print("ELECTIONRESULTS BY PERCENTAGE") name 11 _main___": election_results()
Expert Answer:
Answer rating: 100% (QA)
graph LR subgraph Election Results start Ask numcandidates Ask numcandidates Validate numcandidates ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
A spaceship is orbiting around the Earth. The mass of Earth is 5.98 x 1024 kg, and the mass of the spaceship is 8600 kg. Let R be the distance from the center of Earth. If this distance changes from...
-
You are considering a maintenance contract from two vendors. Vendor Y charges $80,000 upfront and then $13,000 per year for the three-year life of the contract. Vendor Z charges $100,000 upfront and...
-
Three transactions for Sunland Gifts are presented here. On October 2, Sunland Gifts purchased $35,500 of merchandise from Sea Toys, terms 1/10, n/30. On October 6, Sunland Gifts returned $2,800 of...
-
Write a program that displays the color study shown at right, which gives Albers squares corresponding to each of the 256 levels of blue (blue-to-white in row major order) and gray (black-to-white in...
-
Show that the function is a solution of the differential equation f(x) + f(x) = 0
-
GMM Inc. has a beta of 1.2. The market risk premium is currently 7%, and the return on treasury bills is 4%. What is the best estimate of GMM's cost of equity?
-
Use stepwise regression to build a model for the NBA Combine data in Table B.23. Perform a residual analysis on the final model. Compare this model to the all possible regressions model from Problem...
-
Minelli Enterprises uses large amounts of copper in the manufacture of ceiling fans. The firm has been very concerned about the detrimental impact of rising copper prices on its earnings and has...
-
A dataset is given below. Calculate the odds ratio to assess the relationship between visiting a petting zoo and becoming infected by E. coli. Interpret the result. Got Sick (Cases) Did Not Get Sick...
-
The Sally Coffee Shop is considering closing one hour earlier in the evening through the week. Sally obtained the following data from a study taken last week of the number of customers between the...
-
Determine the maximum number of real zeros for f(x) = 2x3 + x - 3x - 1 x-3x-1
-
If one euro is priced at bid 9.15 /ask 9.22 Swedish crowns, how many euros can you purchase for 50 Swedish crowns?
-
How is the size of the forecast interval affected when we use values of x that are much greater or much less than the mean value of x for forecasting?
-
Carli Wainer is going to set up a new business in Bruges on 1 January 2021. She estimates that her first six months in business will be as follows: (i) She will put 150,000 into the firm on 1...
-
Briefly explain how we can use regression analysis to forecast values of y.
-
Sasha Parker is going to set up a new business on 1 January 2021. She estimates that her first six months in business will be as follows: (i) She will put 150,000 into a bank account for the firm on...
-
Let <3,-2,1 >, < 2,-4,-3>, and W = < -1,2,2 >. a) (3 pts) Determine a unit vector perpendicular to both and w. b) (3 pts) Find the volume of the solid whose edges are u, , and w. c) (2 pts) Find the...
-
Which of the following streaming TV devices does not involve use of a remote controller? A) Google Chromecast B) Apple TV C) Amazon Fire TV D) Roku
-
Carl and Jenny adopt a Russian orphan. The adoption takes 2 years and two trips to Russia and is final in 2012. They pay $6,000 in 2011 and $7,500 in 2012 of qualified adoption expenses, and have AGI...
-
a. Wilson filed his individual tax return on the original due date, but failed to pay $700 in taxes that were due with the return. If Wilson pays the taxes exactly 2 months late, calculate the amount...
-
Janie graduates from high school in 2012 and enrolls in college in the fall. Her parents pay $4,000 for her tuition and fees. a. Assuming Janie's parents have AGI of $170,000, what is the American...
-
Determine the probability mass function of \(X\) from the following cumulative distribution function: \[ F(x)=\left\{\begin{array}{lr} 0 & x. \] Figure 3.3 displays a plot of \(F(x)\). From the plot,...
-
Two new product designs are to be compared on the basis of revenue potential. Marketing believes that the revenue from design A can be predicted quite accurately to be \(\$ 3\) million. The revenue...
-
The probability that a wafer contains a large particle of contamination is 0.01. If it is assumed that the wafers are independent, what is the probability that exactly 125 wafers need to be analyzed...
Study smarter with the SolutionInn App