1 / 20

ARRAYS WHAT DO YOU REMEMBER?

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

joshua
Download Presentation

ARRAYS WHAT DO YOU REMEMBER?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ARRAYSWHAT DO YOU REMEMBER?

  2. 30 SECONDS All Arrays consist of two parts, the I….. and the E…….. In an Array, what is I and what is E?

  3. 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?

  4. 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?

  5. 30 Seconds Name the four components of the Von Neumann Architecture

  6. 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?

  7. 1Minutes Convert the following two’s compliment binary number into decimal. 10001000 =

  8. 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

  9. 30 SECONDS All Arrays consist of two parts, the I….. and the E…….. Index Element

  10. 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

  11. 30 Seconds Dim pets() As String = {"Jeff", "Bailey", "Mutt", "Sally"} Console.WriteLine(pets(2)) Mutt

  12. 30 Seconds Name the four components of the Von Neumann Architecture Processor, Main Memory, Input/Output, System Bus

  13. 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

  14. 2 Minutes Convert the following two’s compliment binary number into decimal. 10001000 = -120

  15. 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)

  16. ARRAYS AND THE CONSOLE

  17. 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

  18. METHOD 2 Console.WriteLine("Method Two”) For Each element As Integer In numberArray Console.Write(element & " ”) Next

  19. METHOD 3 Console.WriteLine("MethodThree”) Array.ForEach(numberArray, Sub(i As Integer) Console.Write(i & " ”) End Sub)

  20. METHOD 4 Console.WriteLine("Method Four”) Array.ForEach(numberArray, Sub(i As Integer) Console.Write(i & " "))

More Related