The file Senate113.txt contains the members of the 113th U.S. Senate that is, the Senate prior to
Question:
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 fieldsname, state, and party affiliation.3 Some records in the file are as follows:
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:
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:
(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), (c), and (d).
(b) Write a program that determines the number of senators of each party affiliation. See Fig. 5.49.
(c) Write a program that determines the number of states whose two senators have the same party affiliation.
(d) Write a program that asks the user to input a state, and then displays the two senators from that state. See Fig. 5.50.