In: Computer Science
write a small visual basic console program to output the ages of three students
Application Name :ConsoleApp_Age
Type of Application :Console Application
Language used :VB
Module1.vb :
Module Module1 'VB Module
Sub Main()
'declaring variable for number of student
Dim numberOfStudents As Integer = 0
Dim DOB As Date
'using while loop
While numberOfStudents < 3
'asking student date of birth
Console.Write("Enter date of Birth (mm/dd/yyyy) :")
'reading date of birth
DOB = Date.Parse(Console.ReadLine())
'calculate and print age
Console.WriteLine("Student with " & DOB & " date of Birth
having age " & (Date.Now().Year - DOB.Year).ToString())
'increment value of numberOfStudents
numberOfStudents =numberOfStudents+1
End While
End Sub
End Module
================================================
Output :