VBScript IP Array Report
In the space provided below, copy and paste your IP_Array.vbs Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program
In the space provided below to copy and paste the remainder of your IP_Array.vbs sourcecode.
In the space provided below, copy and paste the RUN of your IP_Array.vbs program:
The lab instructions
VBScript IP Array Lab
In this lab, students will complete the following objectives. Create a VBScript Program using NotePad++.
Access a two-dimensional array.
Use a Nested For Loop to display array contents.
Use Do/While loops for error-handling.
Use CStr( ), CInt( ), and chr( ) functions.
During your session you will have access to the following lab configuration.
Connecting to your lab
For this lab, we will only need to connect to Vlab-PC1.
To start simply click on the named Workstation from the device list (located on the left hand side of the screen) and click the Power on from the in tools bar. In some cases the devices may power on automatically. During the boot up process an activity indicator will be displayed in the name tab: Black - Powered Off
Orange - Working on your request
Green - Ready to access
If the remote console is not displayed automatically in the main window (or popup) click the Connect icon located in the tools bar to start your session. If the remote console does not appear please try the following option: Switch between the HTML 5 and Java client versions in the tools bar.
In the event this does not resolve your connectivity problems please visit our Help / Support pages for additional resolution options.
Task 1: Open IP_Array_start.vbs
Note: Note: All captures must be text only—DO NOT capture the NotePad++ application window or the command prompt window. Use copy and paste of text only. Open NotePad++ and use File/Open to open IP_Array_start.vbs in the C:\comp230 directory. Modify the Programmer Header as needed. and Save As the file with the new name of IP_Array.vbs.
The line dim ipAddress(5,3) declares a 6x4 2-dimensional array. The 5 and 3 give the maximum index value. Since the index starts at 0, this is a 6x4 array.
The lines that follow initialize the array locations with IP addresses. The first index (0..5) represents the rooms 100 through 105. The second index (0..3) represent the four computers in each room. Let’s visualize what the data in the ipaddress array looks like:
Comp 1 (col 0)
Comp 2 (col 1)
Comp 3 (col 2)
Comp 4 (col 3)
Rm 100 (row 0)
Rm 101 (row 1)
Rm 102 (row 2)
Rm 103 (row 3)
Rm 104 (row 4)
Rm 105 (row 5)
The grayed section represents your ipaddress array, which has 6 rows (numbered 0 to 5) and 4 columns (numbered 0 to 3). To get a particular IP address requires you to select the proper row and column.
If you know the room number, to get the proper row for the data you need to subtract 100. If you enter room 103, subtract 100 and you get row 3
If you know the computer number, to get the proper column for the data you need to subtract 1. For computer 2, subtract 1 and you get column 1. The IP address of the third computer in room 104 can be found in the array element or component Address(4,2). This value is “192.168.10.45”. Look at the array carefully to determine the meaning of the index values.
Now that you have an initialized two-dimensional array, it will be your job to query the array for the IP address for any computer (1–4) in any room (100–105).
Task 2: Validate Input and Query Array for IP Addresses
1) Let’s start by defining our program variables. We need two sets of variables:...
Please join StudyMode to read the full document