The city of Green Acres is holding an election for mayor. City officials have decided to automate the process of tabulating election returns and have hired your company to develop a piece of software to monitor this process. The city is divided into five precincts. On election day, voters go to their assigned precinct and cast their ballots. All votes cast in a precinct are stored in a data file that is transmitted to a central location for tabulation.

Required:
Develop a program to count the incoming votes at election central.

Answers

Answer 1

Answer:

Explanation:

The following program asks the user to enter the precinct number and then loops to add votes until no more votes need to be added. Then it breaks the loop and creates a file called results to save all of the results for that precinct.

precinct = input("Enter Precinct Number: ")

option1 = 0

option2 = 0

while True:

   choice = input("Enter your vote 1 or 2: ")

   if int(choice) == 1:

       option1 += 1

   else:

       option2 += 1

   endVote = input("Vote again y/n")

   if endVote.lower() != 'y':

       break

f = open("results.txt", "w")

f.write("Precinct " + precinct + ": \nOption 1: " + str(option1) + "\nOption 2: " + str(option2))

The City Of Green Acres Is Holding An Election For Mayor. City Officials Have Decided To Automate The

Related Questions

What are some examples and non-examples of digital security?

Answers

Answer:

Devices such as a smart card-based USB token, the SIM card in your cell phone, the secure chip in your contactless payment card or an ePassport are digital security devices

Parts of a computer software

Answers

Answer:

I think application software

utility software

networking software

Other Questions
BRAINLY IF YOU DO IT RIGHT AND WITH EXPLANATIONIn Carl Sandburg's poem "Fog," how do readers know that fog is being compared to a cat?It is directly called a cat.It is shaped like a cat.It sounds like a cat.It moves like a cat. Match the word with the correct definition. Drag the terms on the left to the appropriate blanks on the right. ResetHelp blank impermeable layer that prevents flow. impermeable layer that prevents flow. blank rock or regolith that can store and transmit water but is contained between two impermeable layers. rock or regolith that can store and transmit water but is contained between two impermeable layers. blank rock or regolith that can store and transmit water and receives its recharge directly from the atmosphere. rock or regolith that can store and transmit water and receives its recharge directly from the atmosphere. *PLEASE ANSWER!! HURRY*Abolitionists supported what cause?a.) The freedom and rights of blacks and increased rights of women.b.) The rights of freedom of blacks.c.) The rights of black men. Solve for x. round to the nearest tenth. please help!! Which of these is an opinion?Press enter to interact with the item, and press tab button or down arrow until reaching the Submit button once the item is selectedAJoining the British Army included risks such as being executed by Americans if captured.BHaving the Colonial Marines see action immediately after training was a risky decision.CThe British wanted to move the Colonial Marines to other parts of the empire after the war.DThe men and women who couldn't become Colonial Marines still took part in the war effort. Construct an isosceles triangle with the given base and the opposite angle to the base. (2p^3 2p)^2HELLO I NEED HELP HELPNO LINKSI NEED TO TURN THIS IN ASAP I APPRECIATE ALL HELP Please help me i need the right answer fast! hi please helpppppppp Pls help Ill addd extra points The very beginning of Brave New World centers on aGroup of answer choicesUniversity lecture.Tour of a factory.Secret meeting of the World State.Man alone on an island. Wendy borrowed a 370-page book from the library. She has already read 20 pages. The book is due back to the library in 7 days. Write an inequality to find the number of pages per day Wendy must read in order to finish the book before it is due.0 points diferences between football and flag football Use a proportion to estimate each population. (Please solve both questions, thank you) (Ill reward you with brainliest :)20. total counted: 102tagged counted: 38total tagged: 5621. total counted: 958tagged counted: 210total tagged: 305 Your friend earns 7x dollars forworking x hours. How much doesyour friend earn for working16 hours? 40 hours?16 hours $40 hours $ After graduation, you face a choice. You can work for a multinational consulting firm and earn a starting salary (including benefits) of $40,000, or you can start your own consulting firm using $5,000 of your own savings. If you keep your money in a savings account, you can earn an interest rate of 7 percent. You choose to start your own consulting firm. At the end of the first year, you add up all of your expenses and revenues. Your expenses include $14,000 for rent, $1,000 for office supplies, $24,000 for labor, and $4,500 for telephone expenses. After operating your consulting firm for a year, your total revenues are $88,000.Required:What are your total explicit cost and total implicit costs? Graph the function.f(x) = 3/8 (x1)(x9) Which of the following is not true about ocean acidification?A) caused by excessive CO2 in the atmosphereB) it decreases concentration of CO32- needed for marine life shell formationC) caused by floodingD it is caused by decreased pH 7. An administrator surveys a random sample of 48 out of 900 middle school students. Using thesurvey results, the administrator predicts that 225 students are in favor of the new dress code.How many of the 48 students surveyed were in favor of the new dress code?