Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Visual Basic U.S. Senate The file Senate113.txt contains the members of the 113th U.S. Senatethat is, the Senate prior to the November 2014 election.

Using Visual Basic

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.

image text in transcribed

Figure 8.38 Outcome of Programming Project 2(b).

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.

image text in transcribed

Figure 8.39 Outcome of Programming Project 2(c).

C. Write a program that asks the user to select a state from a list box, and then displays the two senators from that state. See Fig. 8.40.

image text in transcribed

Figure 8.40 Possible outcome of Programming Project 2(d).

U.S. Senate U.S. Senate- X Count Party Affiliations Democrats: 44 Republicans: 54 Independents: 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions

Question

4. Does cultural aptitude impact ones emotional intelligence?

Answered: 1 week ago

Question

7. Do the organizations social activities reflect diversity?

Answered: 1 week ago