Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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

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 person1, Person2 As Person

a. (a) Give person1 the name Michael

b. (b) Set Michael's height and weight to 71 and 190, respectively

c. (c) Give person2 the name Jacob

d. (d) Set Jacob's height and weight to 70 and 175, respectively

e. (e) 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]."
In exercises 15 through 18 describe the output that results from clicking on the button. The programs use the file Cities.txt 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:


New York, NY,80.1,82.7
Los Angeles,CA,36.9,38.84
Chicago,IL,29.0,28.7
Houston,TX,19.5,22.4


Assume that each program contains the following code:
Structure City
Dim name As String
Dim state As String
Dim pop2000 As Double
Dim pop2010 As Double
End Structure


Dim cities() As City


Private Sub frmCities_Load(...) Handles Me.Load
'Place the data for eaech city into the array cities
Dim cityRecords() = IO.File.ReadAllLines("Cities.txt")
'Use the array cityRecords to populate the array cities.
Dim n = cityRecords.Count = 1


ReDim cities(n)
Dim line As String 'holds data for a single city
Dim data() As String
For i As Integer = 0 to n
line = cityRecords(i)
data = line.Split(","c)
cities(i).name = data(0)
cities(i).state = data(1)
cities(i).pop2000 = CDbl(data(2))
cities(i).pop2010 = CDbl(data(3))
Next
End Sub


HERE ARE THE QUESTIONS!


16. Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
dim query = From cty In Cities
Where city.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
1stOutput.Items.Add(cty.name & ", " & cty.state)
Next
1stOutput.Items.Add("Greatest growth: " &
FormatPercent (query.First.growth))
End Sub






18. Private Sub btnDisplay_Click(...) Handles btn.Display.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

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91036165
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question scrum dsdm and agile unified processbullcompare

Question: "Scrum, DSDM, and Agile Unified Process" • Compare and contrast agile unified process and the process groups outlined in Project Management Body of Knowledge (PMBOK). Provide one (1) example of each process (Sc ...

The decomposition of so2cl2 is first order in so2cl2 and

The Decomposition of SO2Cl2 is first order in SO2Cl2 and has a rate constant of 1.42*10-4s-1 at a certain temperature. What is the half-life for this reaction?

A student raises her hand in class and states i can legally

A student raises her hand in class and states, "I can legally copy any DVD I get from Netflix because Netflix purchased the DVD and the copyright only applies to the company who purchased the product." Explain whether th ...

A chemistry student needsnbsp700 ml of dimethyl sulfoxide

A chemistry student needs 70.0 mL of dimethyl sulfoxide for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of dimethyl sulfoxide is 1.10 g.cm^-3. Calculat ...

Many high school students take the ap tests in different

Many high school students take the AP tests in different subject areas. In 2007, of the 144,796 students who took the biology exam 84,199 of them were female. In that same year, of the 211,693 students who took the calcu ...

Need a use case diagram for a case studythe case studypaul

Need a use case diagram for a case study: The case study Paul is the Director of IT Services for a consulting firm Avant. The firm has been growing fast since it was launched in 2010. With over 100 employees and hundreds ...

Suppose our task is to distinguish between humans and

Suppose our task is to distinguish between humans and non-human objects in an image, which classifier would you choose and why? Decision trees, perceptrons or neural nets.

The economic dynamism which is the index of productive

The economic dynamism, which is the index of productive growth in dollars for countries that are designated by the World Bank as middle-income are in table #8.3.9 ("SOCR data 2008," 2013). Compute a 95% confidence interv ...

What are some breakthrough events in the evolution of

What are some breakthrough events in the evolution of elearning?

In a nationwide poll of 1500 randomly selected us residents

In a nationwide poll of 1500 randomly selected U.S. residents, 77% said they liked pizza. In a poll of 1500 randomly selected U.S residents one month later, 75% responded they liked pizza. a. Does the polling evidence su ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As