Write a program that uses the xml file from par display name

Assignment Help Database Management System
Reference no: EM13776396

1. Determine the first two lines of the new file created by the code below. This exercise refers to the file Justices.txt that contains data about the Supreme Court justices, past and present. Each record contains six fields - first name, last name, appointing president, home state, year appointed, and year they left the court. If they are still on the court, the last field is set to 0. The first two lines of the file are as follows

Samuel, Alito, George W. Bush, NJ, 2006, 0

Henry, Baldwin, Andrew Jackson, PA, 1844

Dim query = From line Int IO.File.ReadAllLines("Justices.txt")

Let data = line.Split(","C)

Let firstName = data(0)

Let lastName = data(1)

Let fullName = firstName & " " & lastName

Let state = data(3)

Select fullName & "'" & state

IO.File.WriteAllLines("NewFile.txt", query)

2. Describe the new file created by the code.

Dim query = From line In IO.File.ReadAllLines("Justices.txt")

Let data = line.Split(","c)

Let firstName = data(0)

Let lastName = data(1)

Let state = data(3)

Let yrAppointed = CInt(data(4))

Let fullName = firstName & " " & lastName

Let newLine = state & ", " & fullName

Where (yrAppointed >= 1990) And (yrAppointed < 2000)

Order By yrAppointed

Select newline

IO.File.WriteAllLines("NewFile.txt", query)

3. Determine the output displayed in the text box when the button is clicked.

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click

Dim salutation, welcome As String

Dim sw As IO.StreamWriter = IO.File.CreateText("Greetings.txt")

sw.WriteLine("Hello")

sw.WriteLine("Aloha")

sw.Close()

Dim sr As IO.StreamReader = IO.File.OpenText("Greetings.txt")

salutation = sr.Readline

welcome = sr.Readline

sr.Close()

txtOutput.Text = welcome

End Sub

4. Identify any errors. Assume that the contents of the Greetings.txt file are:

Hello

Aloha

Bon Jour

Private Sub btnDisplay_Click(...) Handles btnDisplay.Click

Dim name, greeting As String

Dim sr As IO.StreamReader = IO.File.OpentText("Greetings.txt")

name = "NewGreet.txt"

Dim sw As IO.StreamWriter = IO.CreateText("name")

Do Until sr.EndOfStream

greeting = sr.Readline

sw.Writeline(greeting)

Loop

sr.Close()

sw.Close()

End Sub

5. The first two lines of the file AgetAtInaug.txt are

George Washington, 57

John Adams, 61

whereeach record has two fields - name of president and his age when inaugurated. Create an XML file containing these two records

6. The CSV file Senate.txt contains a record for each member of the 111th U.S. Senate. (The 111th U. S. Senate was installed in 2009.) Each record contains three fields - name, state, and party affiliation. Some records in the files are

John McCain, Arizona, R

Joseph Lieberman, Connecticut, I

Kirsten Gillibrand, New York, D

(a) Write a program that uses the file Senate111.txt and creates an XML file containing the same information.

(b) Write a program that uses the XML file from par (a) to display the names, states, and party affiliation of all the senators in the DataGridView in order by state. The two senators from each state should be in order by their first names.

Reference no: EM13776396

Questions Cloud

Nurture factors contribute to one self-efficacy : Define cognition and provide a description of the cognitive processes. What is the relationship between cognition and personality development?
Summary of the salient points : Select one talk that is of interest to you and watch it in its entire length. Write a 700- to 1,050-word summary of the salient points made in the talk and its supporting details that catch your interest. Indicate the name and position of the speaker..
Role of social services in abuse and neglect cases : Requirements of Indian Child Welfare Act (ICWA), Role of court-appointed special advocates (CASA) in child abuse and neglect cases and Role of Social Services in abuse and neglect case
Construct the direct labor budget : Captain Corporation is working on its direct labor budget for the next two months. Each unit of output requires 0.41 direct labor-hours. The direct labor rate is $8.50 per direct labor-hour. The production budget calls for producing 2,300 units in Au..
Write a program that uses the xml file from par display name : Write a program that uses the XML file from par (a) to display the names, states, and party affiliation of all the senators in the DataGridView in order by state. The two senators from each state should be in order by their first names.
State of south australia v marcus clark - case study : State of South Australia v Marcus Clark (1996) Need case study essay in IRAC method format. with proper issue, rule, application and conclusion
Explain the importance of planning a website : Explain the importance of planning a website. Plan a website with navigation links. Analyze the look of a website. Create and save a document named ReadingSummary.pdf
Data presented what it be advisable to make carrying case : Matchless computer company has been purchasing carrying cases for its portable computers and delivered cost of $55 per unit the company which is currently operating below full capacity charges factory overhead to production at the rate of 40 percent ..
Discuss the law or laws you were assigned : Discuss the law or laws you were assigned and Discuss U.S. Constitution amendments implemented to protect the rights of businesses and organizations according to your law

Reviews

Write a Review

Database Management System Questions & Answers

  Establish a single control transport connection

This connection would be used to carry control signals relating to all user transport connection between the two entities. Discuss the implications of this strategy.

  To analyse a set of data and write a memo identifying and

to analyse a set of data and write a memo identifying and explaining your insights into the operation of todd

  The cio asks you to describe why you believe it is

you are the information security officer at a medium-sized company 1500 employees. the cio asks you to explain why you

  Design pattern for web based database interfaces

We have implemented the MVC design pattern for Web based database interfaces. However, there are other design patterns that may be directly applicable to PHP programming, or web programming in general.

  Draw the er diagram using industral-style notations

Each department is described by a name, department code, office number, office phone, and college. Both name and code have unique values for each department.

  Convert the erd

Using the descriptions of the attributes given in the, convert the ERD shown in Figure P6.2 into a dependency diagram that is in 3NF.

  Create a database design specification enhanced entity

create a database design specification enhanced entity relationship diagram eerd and relational data model rdm from the

  Scenariowallsherpool sixth form college -theatre

scenariowallsherpool sixth form college -theatre companywallsherpool sixth form college is located in the north east of

  Justify a question on database management

When a student has not chosen a major at a university, the university often enters a value of "Undecided" for the major field. Is "Undecided" a way to represent the null value? Should it be used as a default value? Justify your answer carefully.

  Write a select statement that returns three columns

Write a SELECT statement that returns three columns: EmailAddress, OrderID, and the order total for each customer. To do this, you can group the result set by the EmailAddress and OrderID columns.

  1modify the database by adding an additional column

1.modify the database by adding an additional column deleteddate to those tables that represent entities that could

  Write a select statement that answers this problem

Write a SELECT statement that answers this problem - Which products have a list price that's greater than the average list price for all products?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd