Question
Using Visual Basic HAVING ALREADY ANSWERED PART A AND B PLEASE HELP WITH C. U.S. Senate The file Senate113.txt contains the members of the 113th
Using Visual Basic HAVING ALREADY ANSWERED PART A AND B PLEASE HELP WITH C.
U.S. SenateThe file Senate113.txt contains the members of the 113th U.S. Senatethat is, the Senate prior to the November 2014 election. Each record of the file consists of three fieldsname, state, and party affiliation.2 Some records in the file are as follows:
2We refer to anyone who is neither a Republican nor a Democrat as Independent.
Richard Shelby,Alabama,R Bernard Sanders,Vermont,I Kristen Gillibrand,New York,D
he 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,D
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 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), (c), and (d).
B. Write a program that determines the number of senators of each party affiliation. See Fig. 8.38.
C. Write a program that determines the number of states whose two senators have the same party affiliation. See Fig. 8.39. Hint: Use a procedure with the heading Function SameParty(state As String) As Boolean.
Figure 8.39 Outcome of Programming Project 2(c).
U.S. Senate- X Count the Number of States whose Senators have the same Party Affiliation 35Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started