Question

In: Computer Science

write a small visual basic console program to output the ages of three students

write a small visual basic console program to output the ages of three students

Solutions

Expert Solution

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 :


Related Solutions

Write a C program The Visual Studio project itself must make its output to the Console...
Write a C program The Visual Studio project itself must make its output to the Console (i.e. the Command Prompt using printf) and it must exhibit the following features as a minimum: 3%: Looping Menu with 3 main actions: View Cars, Sell Car, View Sales Note: A Car is defined by its price and model 3%: Must contain at least three arrays to record sales figures (maximum of 10 Car models) Two for recording the price and model of one...
Make a Console application Language should be Visual Basic In this assignment, you will be calculating...
Make a Console application Language should be Visual Basic In this assignment, you will be calculating the two parts for each month. you calculate the interest to pay each month and principal you pay every month. The interest you pay every month = loan * monthlyInterest The principal you pay every month = monthlyMortgage -  interest you pay every month ' what is my remaining loan loan = loan - principal you pay every month Problem 1 : Using While Loop,...
Make a Console application Language should be Visual Basic You will be simulating an ATM machine...
Make a Console application Language should be Visual Basic You will be simulating an ATM machine as much as possible Pretend you have an initial deposit of 1000.00. You will Prompt the user with a Main menu: Enter 1 to deposit Enter 2 to Withdraw Enter 3 to Print Balance Enter 4 to quit When the user enters 1 in the main menu, your program will prompt the user to enter the deposit amount. If the user enter more than...
Write a program Write a program whose inputs are three integers, and whose output is the...
Write a program Write a program whose inputs are three integers, and whose output is the smallest of the three values. Ex: If the input is: 7 15 3 the output is: 3 C++ please
Write a statement to output on the console the valueof the last element in a...
Write a statement to output on the console the value of the last element in a single-dimensional array of integers called grades.
Write Visual Basic program that seperates all natural numbers up to 863 value with a comma...
Write Visual Basic program that seperates all natural numbers up to 863 value with a comma side by side and show on the screen Please write readable.Thankss
Language: c++ using visual basic Write a program to open a text file that you created,...
Language: c++ using visual basic Write a program to open a text file that you created, read the file into arrays, sort the data by price (low to high), by box number (low to high), search for a price of a specific box number and create a reorder report. The reorder report should alert purchasing to order boxes whose inventory falls below 100. Sort the reorder report from high to low. Inventory data to input. Box number Number boxes in...
Using If-Else conditional statement write a Visual Basic Program to display: (i) “STOP” if the user...
Using If-Else conditional statement write a Visual Basic Program to display: (i) “STOP” if the user enters “R” (ii) “CAUTION” if the user enters “Y” (iii) “GO” if the user enters “G” (iv) “Invalid” if the user enters any other character
Write a program that reads students’ names followed by their test scores. The program should output...
Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed by the test scores and the relevant grade. It should also find and print the highest test score and the name of the students having the highest test score. Student data should be stored in a struct variable of type studentType, which has four components: studentFName and studentLName of type string, testScore of type int (testScore is between 0 and...
Write a C program of car sale: The Visual Studio project itself must make its output...
Write a C program of car sale: The Visual Studio project itself must make its output to the Console (i.e. the Command Prompt using printf) and it must exhibit the following features as a minimum: 10%: Looping Menu with 2 main actions: Sell Car, View Sales Note: A Car is defined only by its price 10% Must contain at least one array containing sales figures (each entry represents the price of one vehicle) for a maximum of 10 Cars 5%:...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT