Question

In: Computer Science

VISUAL BASIC (VB.NET)1. Create a Sub Procedure with a name of your choice and in the...

VISUAL BASIC (VB.NET)1. Create a Sub Procedure with a name of your choice and in the procedure, declare a
2-Dimensinal (2-D) array that can store 15 Integer numbers. Then implement a
nested loop that will be used to store any 15 Integer numbers into the 2-D array at
runtime (an interactive program).
The implementation will be such that the program cannot terminate unless all the
inputs provided are integers (user input validation). If you provide an invalid input,
you should be asked to “Try again”. Make sure also to print out all valid inputs
respectively, after the point of insertion.
Note – The Procedure you created should be called in the Main Procedure to run it.

Solutions

Expert Solution

Application name :ConsoleApp_Integers

Application type :Console Application

Language used :VB

IDE used :Visual Studio 2019

Module1.vb :

Module Module1 'Module

Sub Main() 'Main Procedure
'calling sub procedure in main() procedure
getIntegers()
End Sub
'Procedure to get the integers from user
Sub getIntegers()
'Declare a 2-Dimensinal (2-D) array that can store 15 Integer numbers
Dim integerNumbers(2, 4) As Integer
'declaring variable to read and store integer
Dim number As Integer
'using for loop
For i = 0 To 2
For j = 0 To 4
'asking user to enter an integer
Console.Write("Enter an integer (" & i & "," & j & ") : ")
If Integer.TryParse(Console.ReadLine(), number) Then
'when valid integer is entered
'store integer in the array
integerNumbers(i, j) = number
Else
'When invalid integer is entered
'display error message
Console.WriteLine("Try again")
j = j - 1 'decrement value of j
End If
Next
Next
'display valid integers from array
Console.WriteLine(Environment.NewLine & "------------Valid Integers are :-------------")
'using for loop
For i = 0 To 2
For j = 0 To 4
'display integer from array
Console.Write(integerNumbers(i, j) & " ")
Next
Console.WriteLine() 'used for new line
Next
End Sub

End Module
===============================================

Output :


Related Solutions

Visual Basic Your first job is to create a visual basic project that will display the...
Visual Basic Your first job is to create a visual basic project that will display the name and telephone number for the contact person for the customer relations, marketing, order processing, and shipping departments. Include a button for each department. When the user clicks on the button for a department the program(in code for specific button will display the name and telephone number for the contact person in two labels. The same two labels will be used for each department...
create a Visual Basic project with the following features: 1. The user interface can display the...
create a Visual Basic project with the following features: 1. The user interface can display the following information, one textbox for one item: 1a. Author, in the form of Lastname, Firstname 1b. Title 1c. Source -- where the paper is published 1d. Abstract 1e. Publication year (This information is in the 1c. Source, but display the publication year separately here) 2. There is a command button "Import". It would allow the user to select the eric.txt as the input file...
NOTE: This is done using Visual Basic. Create an application named You Do It 1. Add...
NOTE: This is done using Visual Basic. Create an application named You Do It 1. Add a text box, a label, and a button to the form. The button’s Click event procedure should store the contents of the text box in a Double variable named dblCost. It then should display the variable’s contents in the label. Enter the three Option statements above the Public Class clause in the Code Editor window, and then code the procedure. Save the solution and...
Use Visual Basic Language In this assignment you will need to create a program that will...
Use Visual Basic Language In this assignment you will need to create a program that will have both a “for statement” and an “if statement”. Your program will read 2 numbers from the input screen and it will determine which is the larger of the 2 numbers. It will do this 10 times. It will also keep track of both the largest and smallest numbers throughout the entire 10 times through the loop. An example of the program would be...
In this project, you will create a Visual Basic solution to perform customer billing at the...
In this project, you will create a Visual Basic solution to perform customer billing at the Cyberian Internet Cafe. Please see below for the detailed instructions. You will create the project and then design a form using the image provided here. Then, add the necessary code to do the billing calculation and display the amount due. Instructions In this case, you will create a Visual Basic solution that performs customer billing for the Cyberian Internet Café. The Cyberian Internet Café...
As a group of engineers with basic Visual Basic skills, you are asked to provide your...
As a group of engineers with basic Visual Basic skills, you are asked to provide your client with a user-friendly macro-enabled Excel spreadsheet that can be used to calculate the deflection and bending moment of a simply supported beam and a cantilever beam. The spreadsheet will provide a user-friendly interface to allow the client to: i) define the type of beam (i.e. a simply supported beam or a cantilever beam); ii) define cross sectional properties of a given beam structure;...
In Assembly Language (Visual Studio 2017), create a procedure that generates a random string of Length...
In Assembly Language (Visual Studio 2017), create a procedure that generates a random string of Length L, containing all capital letters. When calling the procedure, pass the value of L in EAX, and pass a pointer to an array of byte that will hold the random string. Write a test program that calls your procedure 20 times and displays the strings in the console window. In your program, the random string size shall be preset as a constant. Please include...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse...
Description: To create a Visual Basic program that will obtain a sentence from the user, parse the sentence, and then display a sorted list of the words in the sentence with duplicate words removed. Tasks: Design a method (algorithm) to solve the above problem using pseudocode or a flowchart. Translate your algorithm into an appropriate VB program and test it using the following input sentence. "We are the world We are the children" Submit: Pseudocode version of algorithm/Flowchart version of...
Program on Visual Basic, VBA Create an application that lets the user enter a number of...
Program on Visual Basic, VBA Create an application that lets the user enter a number of seconds and produces output according to the following criteria: There are 60 seconds in a minute. If the number of seconds entered by the user is greater than or equal to 60, the program should display the number of minutes in that many seconds. There are 3,600 seconds in an hour. If the number of seconds entered by the user is greater than or...
Create a program in visual basic that allows the user to manage vehicle information including: •...
Create a program in visual basic that allows the user to manage vehicle information including: • License plate number • Owner name • Owner phone number The user interface will be GUI-based providing the following capabilities: • Add up to 100 vehicles • Remove specified vehicles • View a sorted list of all known license plates • View the data for a specified vehicle • Save the database contents into a file • Load a saved database from a file
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT