200 likes | 277 Views
ARRAYS WHAT DO YOU REMEMBER?. 30 SECONDS. All Arrays consist of two parts, the I….. a nd the E…….. In an Array, what is I and what is E?. 30 Seconds. Dim numberArray () As Integer = {5, 13, 3, 8, 7 } For i As Integer = 0 To numberArray.GetUpperBound(0 ) Console.Write ( i & “ “) Next
E N D
30 SECONDS All Arrays consist of two parts, the I….. and the E…….. In an Array, what is I and what is E?
30 Seconds Dim numberArray() As Integer = {5, 13, 3, 8, 7} For i As Integer = 0 To numberArray.GetUpperBound(0) Console.Write(i & “ “) Next What will be the contents of the console when this code is executed?
30 Seconds Dim pets() As String = {"Jeff", "Bailey", "Mutt", "Sally"} Console.WriteLine(pets(2)) What will be the contents of the console when this code is executed?
30 Seconds Name the four components of the Von Neumann Architecture
30 Seconds Dim pets() As String pets(0) = "Dog” pets(1) = "Cat” pets(2) = "Bird” pets(3) = "Snake” Console.WriteLine(pets(1)) What will be the contents of the console when this code is executed?
1Minutes Convert the following two’s compliment binary number into decimal. 10001000 =
5 Minutes Rectangle Programming Task Code has been emailed to you • Complete the programming task • Write the 5 lines of code onto your answer sheet
30 SECONDS All Arrays consist of two parts, the I….. and the E…….. Index Element
30 Seconds Dim numberArray() As Integer = {5, 13, 3, 8, 7} For i As Integer = 0 To numberArray.GetUpperBound(0) Console.Write(i& “ “) Next 0 1 2 3 4
30 Seconds Dim pets() As String = {"Jeff", "Bailey", "Mutt", "Sally"} Console.WriteLine(pets(2)) Mutt
30 Seconds Name the four components of the Von Neumann Architecture Processor, Main Memory, Input/Output, System Bus
30 Seconds Dim pets() As String pets(0) = "Dog” pets(1) = "Cat” pets(2) = "Bird” pets(3) = "Snake” Console.WriteLine(pets(1)) Nothing, size has not been defined in the parameter for the array
2 Minutes Convert the following two’s compliment binary number into decimal. 10001000 = -120
5 Minutes Rectangle Programming Task Dim lengthOfRectangle As Double Console.Write("How long is the rectangle? ”) lengthOfRectangle = CDbl(Console.ReadLine) Dim widthOfRectangle As Double Console.Write("How wide is the rectangle? ”) widthOfRectangle = CDbl(Console.ReadLine) Call computeArea(lengthOfRectangle, widthOfRectangle)
METHOD 1 Sub Main() Dim numberArray() As Integer = {5, 13, 3, 8, 7} Console.WriteLine("Methods of writing Array contents to the console”) Console.WriteLine("MethodOne”) For i As Integer = 0 To numberArray.GetUpperBound(0) Console.Write(numberArray(i) & " ”) Next Console.WriteLine() Console.ReadKey() End Sub
METHOD 2 Console.WriteLine("Method Two”) For Each element As Integer In numberArray Console.Write(element & " ”) Next
METHOD 3 Console.WriteLine("MethodThree”) Array.ForEach(numberArray, Sub(i As Integer) Console.Write(i & " ”) End Sub)
METHOD 4 Console.WriteLine("Method Four”) Array.ForEach(numberArray, Sub(i As Integer) Console.Write(i & " "))