Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Determine the output displayed when the button is clicked.

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

Dim nums() As Integer = {3, 5, 8, 10, 21}

Dim total As Integer = 0

For Each num As Integer In nums

If (num Mod 2 = 0) Then

total += 1

End If

Next

txtOutput.Text = total & " even numbers"

End Sub

2. Determine the output displayed when the button is clicked. Assume the five lines of the file Dates.txt contain the numbers 1492, 1776, 1812, 1929, and 1941 and the file is in the appropriate folder.

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

Dim dates() As String = IO.FilereadAllLines("Dates.txt")

Dim total As Integer = 0

For Each yr As String In dates

If (CInt(yr) >= 1900) Then

Total += 1

End If

Next

txtOutput.Text = total & " 20th-century dates"

End Sub

3. Identify the errors in the following program segment.

Dim nums() As Integer = {1, 2, 3)

For Each num as Integer In nums

Num += 100

Next

MessageBox.Show(CStr(nums.Sum)

4. Determine the output displayed when the button is clicked:

Structure College

Dim name As String

Dim stat As String

Dim yearFounded As Integer

End Structure

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

Dim school As College

school.name = "USC"

school.state = "CA"

school.yearFounded = 1880 ‘Now.Year is the current year

Dim age As Integer = Now.Year - school.yearFounded

txtOutput.Text = school.name & " is " & age & "years old."

End Sub

5. Write a program using the file Baseball.txt that requests a team as input from a list and displays the players from that team.
The players should be sorted in decreasing order by the number of hits they had during the season. The Baseball.txt file contains data about the performance of major league baseball players during the 2009 regular season. Each record of the file contains four fields - name, team, atBats, and hits. Some lines of the file are as follows:

Aaron Hill, Blue Jays, 682, 195

Ichiro Suzuki, Mariners, 639, 225

Derek Jeter, Yankees, 634, 212

The output should look like the following:

6. Determine the errors in the following code.

Structure Vitamins

Dim a As Double

Dim c As Double

End Structure

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

Dim minimum As Vitamins

minimum.c = 60

minimum.a = 5000

lstOutput.Items.Add(minimum)

End Sub

Computer Engineering, Engineering

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

Guranteed 24 Hours Delivery, In Price:- $30

Have any Question?


Related Questions in Computer Engineering

What are content management systems cms describe the

What are Content Management Systems (CMS). Describe the challenges in implementing and maintaining CMS. Can internet search engines be considered as Content Management Systems - explain your answer.

Question a small financial focused business is looking to

Question : A small, financial focused business is looking to organize and secure its network. It currently has a single public IP address from a local telecom. Construct an argument as to how you think a company should e ...

String utilitiesimplement the following methods write a

String Utilities Implement the following methods: // Write a method that returns true if s has leading or trailing whitespace, false otherwise public static boolean needsTrim(String s) // Write a method that swaps the fi ...

Question suppose that a remote transmitter sends a message

Question : Suppose that a remote transmitter sends a message at 2500 Baud and the receiver is expecting the data rate to be 2400 Baud. Calculate the accumulated sample error for one character. Give the answer in bits.

Question include the following items in your paper and

Question: Include the following items in your paper and formal presentation: • A description of the Performance Check and Proficiency Testing targeted for improvement • An As-Is flow chart of the Performance Check and Pr ...

Please explain which formula i should use to complete the

Please explain which formula I should use to complete the following probability question: The probability that a family will buy a vacation home in Miami, malibu, or newport is 0.25, 0.10 and 0.35. What is the probabilit ...

Question sales tax in new york city is 8875write a function

Question : Sales tax in New York City is 8.875%. Write a function float computeTax(float saleamount) that takes the price of a purchase as input, and prints to the screen the amount of the purchase, the sales tax owed, a ...

Tests can determine with some degree of accuracy whether a

Tests can determine, with some degree of accuracy, whether a subject indeed has the disease for which s/he is being tested. For instance, a new screening procedure for heart disease was tested on 100 patients with heart ...

Explain and discuss the following quotepoliticians can be

Explain and discuss the following quote: "Politicians can be strange. They have been calling for the breakup of firms as diverse as energy companies and tech giants like Microsoft and Google because they believe these co ...

In python why would one use a decision statement contained

In Python, Why would one use a decision statement contained inside the branch of another decision statement?

  • 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