Source Code



List Data Student By Array Multidimensi

  • M. Taufik
  • Mar 21' 14
  • VB.NET
  • 366
  • 58
  • United States

Modul ListDataStudent

Sub main()

        Dim Student(,), age, gender, count As String
        Dim colmn As Integer
        colmn = 3

        Console.Write("How many Student data to be entered = ")
        count = Console.ReadLine()
        Do Until IsNumeric(count)
            Console.WriteLine("Sorry Couldn Be Continued, Must be Enter Number!")
            Console.Write("How many Student data to be entered = ")
            count = Console.ReadLine()
        Loop

        ReDim Student(count - 1, colmn)


        For i = 0 To Student.GetUpperBound(0)
            Console.WriteLine()
            Console.WriteLine("Data Student No {0}", i + 1)
            For j = 0 To colmn - 1
                Console.Write("Name Of Student{0}{1}{2} = ", vbTab, vbTab, vbTab)
                Student(i, j) = Console.ReadLine()
                j += 1
                Console.Write("Address Of Student{0}{1} = ", vbTab, vbTab)
                Student(i, j) = Console.ReadLine()
                j += 1
                Console.WriteLine("Notes: (Man(M)/Woman(W)")
                Console.Write("Gender Of Student ( M / W ){0} = ", vbTab)
                gender = Console.ReadLine()
                Do Until gender = "M" Or gender = "W"
                    Console.WriteLine("Sorry Gender Must be M or W")
                    Console.Write("Gender Of Student ( M / W ){0} = ", vbTab)
                    gender = Console.ReadLine()
                Loop
                Student(i, j) = gender
                j += 1
                Console.Write("Ages of Student{0}{1}{2} = ", vbTab, vbTab, vbTab)
                age = Console.ReadLine()
                Do Until IsNumeric(age)
                    Console.WriteLine("Sorry Age Must be Number! ")
                    Console.Write("Ages of Student{0}{1}{2} = ", vbTab, vbTab, vbTab)
                    age = Console.ReadLine()
                Loop
                Student(i, j) = age
            Next
        Next
        Console.WriteLine()
        Console.WriteLine()
        Console.WriteLine("=========== LIST STUDENT DATA =============")
        Console.WriteLine("===========================================")
        Console.WriteLine("NO.  Name        Addres      Gender     Age ")
        Console.WriteLine("===========================================")
        For i = 0 To Student.GetUpperBound(0)
            Console.WriteLine("{0}    {1}{2}{3}{4}{5}{6}{7}{8}", i + 1, Student(i, colmn - colmn), vbTab, Student(i, colmn - 2), vbTab, vbTab, Student(i, colmn - 1), vbTab, Student(i, colmn))
        Next
        Console.WriteLine("===========================================")

    End Sub

End Module
  • Tags :
comments powered by Disqus

Related Code

Find The Maximun, Minimum and Average by Array Season II

Find The Maximun, Minimum and Average by Array

Know the number of odd or even !

Check two files are equal

Define binary type

Coloring Cells in a DBGrid

Coloring Cells in a StringGrid

Disable the Close X button on a Form

Activating the Start Menu by Code

Chart Line Using Morris



Category