Project #27270 - Visual Programing

 

  1. Write a program using a StreamReader that displays the contents of the file attached to this assignment in a DataGridView control. Use the file Cowboy.txt Attache.

     

     

     

     

     

     

     

  2. Use the file USStates.txt attached to this assignment to write a program that accepts state's abbreviation as input and displays the state's name and its area.

 

 

 

 

 

 

Note: File USStates.txt consists of 50 records and four fields, name, abbreviation, land area and population

 

 

 

 

 

 

 

 

 

 

 

  1. What states are displayed in the list box by the following program segment?

 


Dim states() As String = {"Colorado", "New Mexico", "Arizona", "Utah"}
Dim query = From state in states
                     Where ContainsE(state)
                     Select state
For Each state in query
    lstBox.Items.Add(state)
Next

 


Function ContainsE(word As String) As Boolean
   If word.IndexOf("E") <> -1 Or word.IndexOf("e") <> -1 Then
        Return True
    Else
        Return False
    End If
End Function

 

  1. Colorado, New Mexico, Arizona, Utah

  2. No states

  3. Colorado

  4. New Mexico

 

 

 

 

 

 

 

 

 

 

 

  1. What numbers are displayed in the list box by the following program segment?

 


Dim numbers() As Integer = {4, 7, 9, 3, 1}
Dim query = From number in numbers
                    Where number > 6
                     Select number
lstBox.Items.Add(query.Count)
lstBox.Items.Add(query.Average)

 

  1. 2 and 12

  2. 2 and 8

  3. 5 and 12

  4. 5 and 8

     

     

 

  1. What states are displayed in the list box by the following program segment?

 


Dim states() As String = {"Colorado", "New Mexico", "Arizona", "Utah"}
Dim query = From state in states
                   Where state.length < 5
                   Select state.ToUpper
For Each state in query
      lstBox.Items.Add(state)
Next

 

  1. No states

  2. Utah

  3. COLORADO, NEW MEXICO, ARIZONA, UTAH

  4. UTAH

     

     

     

     

     

     

     

     

     

     

 

  1. What two numbers are displayed in the list box when the button is clicked on?

 


Dim nums() as Integer
  

 

Private Sub frmNumbers_Load(...) Handles MyBase.Load
   nums(0) = 5
   nums(1) = 3
   nums(2) = 4
End Sub

 


Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
    lstBox.Items.Add(nums.Average)
    lstBox.Items.Add(nums.Max)
End Sub

 

  1. 4 and 5

  2. 4 and 4

  3. 3 and 5

  4. 3 and 4

 

Subject Computer
Due By (Pacific Time) 04/19/2014 12:00 am
Report DMCA
TutorRating
pallavi

Chat Now!

out of 1971 reviews
More..
amosmm

Chat Now!

out of 766 reviews
More..
PhyzKyd

Chat Now!

out of 1164 reviews
More..
rajdeep77

Chat Now!

out of 721 reviews
More..
sctys

Chat Now!

out of 1600 reviews
More..
sharadgreen

Chat Now!

out of 770 reviews
More..
topnotcher

Chat Now!

out of 766 reviews
More..
XXXIAO

Chat Now!

out of 680 reviews
More..
All Rights Reserved. Copyright by AceMyHW.com - Copyright Policy