preview

Comp230 Week4 Essay

Satisfactory Essays

Student Name | name | Class | COMP230 | Date | 06-01-13 | VBScript IP Array Report In the space provided below, copy and paste your VBScript Program Code. If it doesn’t fit, use the next page for the continuation of your sourcecode program ' VBScript: IP_Array.vbs ' Written by: name ' Date: June 02, 2013 ' Class: COMP230 ' Professor: ' =================================== ' This initialize a 2-dimension array ' of IP Address. The first index +100 ' is the room# and the second index+1 ' is the computer# in the room. dim ipAddress(5,3) …show more content…

Do roomStr=InputBox("Please Enter the Room Number (100-105)....") room = CInt(roomStr) If room < 100 Or room > 105 Then WScript.Echo Chr(7) & Chr(7) MsgBox("Error, 100 to 105 Only!!!") End If Loop While room < 100 Or room > 105

Do compStr=InputBox("Please Enter the Computer Number (1-4)....") computer = CInt(compStr) If computer < 1 Or computer > 4 Then WScript.Echo Chr(7) & Chr(7) MsgBox("Error, 1 to 4 Only!!!") End If Loop While computer < 1 Or computer > 4

WScript.Echo "The IP Address in Room " & room & " for computer " & computer & " is " & ipAddress(room-100,computer-1)

'Display All IP Address Y/N? Do ans=InputBox("Do you wish to Display all of the IP Address (Y/N)....") If ans <> "Y" And ans <> "y" And ans <> "N" And ans <> "n" Then WScript.Echo Chr(7) & Chr(7) MsgBox("Error, Y ,y,N,n response Only!!!") WScript.Echo End If Loop While ans <> "Y" And ans <> "y" And ans <> "N" And ans <> "n"

If ans = "Y" Or ans = "y" Then WScript.Echo For roomNum = 0 to 5 For compNum = 0 to 3 WScript.Echo "The IP Address in Room " & roomNum+100 & " for computer " & compNum+1 & " is " &

Get Access