Determine the output displayed when the button is clicked

Assignment Help Basic Computer Science
Reference no: EM13777931

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

Reference no: EM13777931

Questions Cloud

Assignment-expected value and consumer choices : Consumers' choices are prey to subtle discrepancies that arise in cognitive accounting. Learning how and when you are prey to these discrepancies is an important step in improving your decision making.
What patterns might influence the direction of your research : What patterns might influence the direction of your research? What are the possible policy implications of your research? Provide some examples of policies that might result from your research
Periodic method-balance in ledger purchases account : JaCo uses the periodic method. Its begging inventory is $43,000, purchases are $321,000, FOB destination, purchase returns are $ 17,000, and freight is $ 9,000. The balance in JaCo's ledger Purchases account is?
The need for treatment in the criminal justice system : One of the principles of effective treatment of substance-abusing offenders is: "Develop commitment from jail administrators to support the substance abuse treatment program and provide adequate staff and technical resources." Although this sound ..
Determine the output displayed when the button is clicked : 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.
Do you think what oracle mr ellison was ethical : The Association for Competitive Technology (ACT) is a trade group funded largely by Microsoft Corporation. Do you think what Oracle, Mr. Ellison, and Ms. Lopez did was ethical
What effect will occur to the overall company net income : Central Apparel Company owns two stores and management is considering eliminating the East store due to declining sales. Contribution income statements are as follows and common fixed costs are allocated on the basis of sales. what effect will occur ..
Account balances-purchase returns : WyCo has the following account balances: Purchase Returns $19,000; purchases $812,000; Purchase Discounts $8,000; Begging inventory $21,000; Freight In $30,000; and ending inventory $37,000. WyCo 's cost of goods sold is ?
Identity development in adolescence : Open your paper by introducing the purpose of the paper. Discuss the problem that you researched, the anticipated results (hypothesis) of your data collection, and why you supported this hypothesis.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Write a formal letter using block style

Write a formal letter using block style. Tell the customer there will be no refund, but do so in a "you-oriented" way in which you have a chance of maintaining a relationship going forward.

  Discuss the different program errors that likely to occure

discuss the different program errors that are likely to occur and how they should be handled within scripts

  Briefly discuss the various organizational approaches

1) As a member of an IT staff, how can you use social media to support e-commerce? You can search business websites to find good practices of using social media in e-commerce.

  Write program reads in the length and width of a rectangular

Write a program that reads in the length and width of a rectangular yard (in meters) and the length and width of a rectangular house (in meters) placed in the yard. Your program should compute the time (in minutes) required to cut the lawn around ..

  Explain most of the various models of the shinkansen

Most of the various models of the Shinkansen, Japan's high-speed trains, travel between 240 km/h and 285 km/h. The two exceptions are the Shinkansen "0" series, which began service in 1964, and the new "500" series, which began service in 1997. Se..

  What is chained exceptions in java

What is chained exceptions in java? Explain different layout manager in Java.

  Calculate population increase

The output then would be that count. You will want to use 2 variables, one for the index of the for loop ( and the counter in the do loop) and the other variable to keep track of your "current" population.

  Determine number of toes of chicken using calculations

If radix r utilized by chicken corresponds to its total number of toes, determine how many toes does chicken have on each foot?

  Support desktop computers in small company

Static IP address of server is 192.168.45.200. Employees will open their Web browser and enter personnel.mycompany.com in URL address box to browse Web site.

  Finding different sizes of newspaper for local newspaper

Comprise a specific recommendation regarding how many different sizes newspaper must offer.

  How might an information system administrator make a case

How might an information system administrator make a case for the implementation of Enterprise

  Write guide for the organization

Write a 2-3 page report recommending style manual and/or technical/legal writing guide for the organization to use and describe the reasons for your recommendations.

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