instructions assignment you will write program reads election data file and processes data

Nursingpapertutors.com stands out as a reputable writing company that delivers high-quality papers specifically designed for nursing students. With its specialization in the nursing field, commitment to quality, customization, and originality, timely delivery, dedicated customer support, and emphasis on confidentiality, Nursingpapertutors.com provides invaluable academic support to nursing students. As a reliable partner in their educational journey, Nursingpapertutors.com helps nursing students excel academically and prepares them to become competent and knowledgeable healthcare professionals.

Instructions: For this assignment, you will write a program that reads election data from a file and processes that data in several different ways, inlcuding writing a report to a different file. Data File Format Adams 6457 4385 Asotin 13632 8623 Benton 97849 68834 … The election data we will work with is stored in a simple text file. Each line of the file contains one of 3 different things: • a county name • the number of registered voters in the county • the number ballots counted for the last election (as of noon on November 9th, 2012 for the data file provided) The file format is highly structured. County names are listed in alphabetical order. On the line after each county name is the number of voters registered in that county. On the next line is the number of ballots counted. This sequence is repeated for each county. The first few lines of the sample file are shown at right to illustrate this. Here is a link to the sample file: ElectionData.txt Program Specification Write a program that does the following: • Allow the user to specify the name of an input file containing election data (that way, different data files can be tested). • Read the data from the file and write a report out to a new file as follows: o The name of the output file should be the name of the input file preceeded with the word ‘REPORT’. So, if the input file is named ‘election.txt’, then the output file should be named ‘REPORTelection.txt’. If the input file is named ‘returns.txt’, then the output file should be named ‘REPORTreturns.txt’. o The report should include one line for each county in the data file. The line should list the name of the county followed by the percentage of registered voters who cast ballots. The percentage should be rounded to one place after the decimal point. Here is an example of what the first part of the output file would look like for the data shown above: Adams 67.9% Asotin 63.3% Benton 70.3% … • Finally, show the following information in the Python shell window in a nicely-formatted, easy to understand report: o the total number of county names listed o the total number of registered voters in the state o the total number of ballots counted o the percentage of all registered voters whose ballots were counted o the number of counties with less than 50% of registered voters casting ballots o the percentage of counties with more than 80% of registered voters casting ballots Development Tips: 1. Use a loop to read the data from the file and process the data. Only one loop is needed to do everything! 2. Use a counter to count the total number of county names. 3. Use counters along with ‘if’ statements inside the loop to count the number of counties with less than 50% or more than 80% of registered voters casting ballots. 4. Use accumulators to add up the number of registered voters and the total number of ballots cast. 5. Remember that counters and accumulators always need to be initialized before the beginning of the loop. 6. Plan your progam carefully on paper before you start writing code. Remember that you need to “process” the file one line at a time. You can’t “jump around” to get the info you need like you can do as a human reader. “Be the computer!” 7. Remember that a string value read from a file could have a ‘n’ character at the end of it. ________________________________________ Testing — Be sure to carefully test your program with different files. You can create a simple, short file to make testing easy. As always, be sure to document your testing in comments at the end of the program. Your comments should also say if you think any part of the assignment requirements have not been met. ________________________________________ Grading /12 correctly determines 6 quantities to be shown in the shell window: # counties, # registered voters, # ballots counted, percentage of voters who cast ballots, [removed]80% counties /10 reads and writes files properly (reads data, writes out a report file, closes files, no errors) /3 documented test cases /5 proper comments; good variable names; declarations; indenting; blank lines

Nursingpapertutors.com places a premium on meeting deadlines. The company understands the significance of timely paper submissions for nursing students. To uphold their commitment to punctuality, Nursingpapertutors.com employs a well-organized workflow and efficient team coordination. This ensures that students receive their papers promptly, affording them ample time for review and making any necessary adjustments. Providing exceptional customer support is central to Nursingpapertutors.com’s mission. The company recognizes that nursing students may have queries or require assistance at any time of the day. As such, Nursingpapertutors.com offers 24/7 customer support to promptly address any concerns, clarify instructions, and offer updates on the paper’s progress. Their responsive support team ensures a seamless and positive experience for every student.

 

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.