14 Aug Waiting on an answer
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
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Wridemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Place Order” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.