Question: Could someone solve in Python for C and D? Include screen shots please. 4. U.S. Senate The file Senate113.txt contains the members of the 113th
Could someone solve in Python for C and D? Include screen shots please.

4. U.S. Senate The file Senate113.txt contains the members of the 113th U.S. Senate that is, the Senate prior to the November 2014 election. Each record of the file consists of three fields-name, state, and party affiliation.3 Some records in the file are as follows Richard Shelby ,Alabama,R Bernard Sanders, Vermont,I Kristen G1111brand,New York,D The file RetiredSen.txt contains the records from the file Senate113.txt for senators who left the Senate after the November 2014 election due to retirement, defeat, death, or resignation. Some records in the file are as follows: John Rockefeller,West Virginia,D Tom Coburn,Oklahoma,R Carl Levin, Michigan,ID The file Newsen.txt contains records for the senators who were newly elected in November 2014 or who were appointed to fill the seats of senators who left after the November 2014 election. Some records in the file are as follows: Shelly Capito, West virginia,R Steve Daines,Montana,R Gary Peters, Michigan, D (a) Write a program that uses the three files above to create the file Senate114.txt that contains records (each consisting of three fields) for the members of the 114th Senate where the members are ordered by state. Use this file in parts (b), (b) Write a program that determines the number of senators of each party affiliation (c) Write a program that determines the number of states whose two senators have (d) Write a program that asks the user to input a state, and then displays the two sena- (c), and (d) See Fig. 5.49 the same party affiliation tors from that state. See Fig. 5.50 Party Afrillations: Republ1cans: 54 Democrats: 44 Independents: 2 Enter the name or a state: Maryland Benjamin Cardin Barbara Mikulsk1 FIGURE 6.49 Outcome of Programming Project 4(b) FIGURE 6.50 Outcome of Programming Project 4(d)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
