Private Sub btnDisplay_Click(…) Handles btnDisplay.Click Dim query = From cty In cities

$10.00

Give person I the name Michael.

Give person2 the name Jacob.

 

SKU: Comp090903

A.Write lines of code as instructed in Steps (a) through (e) to fill in the missing lines in the following program.

1.Structure Appearance

Dim height As Double       ‘inches

Dim weight As Double      ‘pounds

End Structure

Structure Person

Dim name As String

Dim stats As Appearance End Structure

Private Sub btnDisplay_Click(…) Handles btnDisplay.Click Dim personl, person2 As Person

(missing lines)

End Sub

  • Give person I the name Michael.
  • Set Michael’s height and weight to 71 and 190, respectively.
  • Give person2 the name Jacob.
  • Set Jacob’s height and weight to 70 and 175, respectively.
  • If one person is both taller and heavier than the other, display a sentence of the form “[name of bigger person] is bigger than [name of smaller person].”

B.In Exercises 15 through 18 describe the output that results from clicking on the button. The programs use the file Cities.ba that contains information about the 25 largest cities in the United States. Each record of the file has four fields—name, state, population in 2000 (in 100,000s), and population in 2010 (in 100,000s). The first four lines in the file are as follows:

1.Private Sub btnDisplay_Click(…) Handles btnDisplay.Click Dim query = From cty In cities

Where cty.state = “TX”

Let growth = (cty.pop2010      cty.pop2000) / cty.pop2000

Order By growth Descending

Select cty.name, cty.state, growth

For Each cty In query

lstOutput.Items.Add(cty.name & “, ” & cty.state)

Next

lstOutput.Items.Add(“Greatest growth: ” &

FormatPercent(query.First.growth))

End Sub

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

Dim query = From cty In cities

Order By cty.pop2010 Descending

Select cty.pop2010

Dim pops() As Double . query.ToArray ReDim Preserve pops(9)

txtOutput.Text = FormatNumber(100000 * pops.Sum, 0)

End Sub

Reviews

There are no reviews yet.

Be the first to review “Private Sub btnDisplay_Click(…) Handles btnDisplay.Click Dim query = From cty In cities”

Your email address will not be published. Required fields are marked *

Sorry no more offers available