COMP230 W4 IP Array Ereport
COMP230 W4 IP Array Ereport
Class
Comp230
Date
' Define Script Variable roomStr="" compStr="" ansStr="" room=0 computer=0 ans=0 Do WScript.StdOut.Write("Please Enter the Room Number (100-105) ...... ") roomStr = Wscript.StdIn.Readline() room = CInt(roomStr) If room < 100 OR room > 105 Then COMP230_W4_IP_Array_Report.docx
In the space provided below to copy and paste the remainder of your VBScript sourcecode.
WScript.StdOut.WriteLine(chr(7) & chr(7) & "Error, 100 to 105 Only!!!") WScript.echo End If Loop While room < 100 OR room > 105 Do WScript.StdOut.Write("Please Enter the Computer Number (1-4) ...... ") compStr = WScript.StdIn.Readline() computer = CInt(compStr) If computer < 1 OR computer > 4 Then WScript.StdOut.WriteLine(chr(7) & chr(7) & "Error, 1 to 4 Only!!!") WScript.echo End If Loop While computer < 1 OR computer > 4 Wscript.StdOut.WriteLine(vbCrLf & "The IP Address in Room " & room & " for computer " & computer & " is " & ipAddress(room-100,computer-1)) WScript.Echo ' Display All IP addresses Y/N? Do WScript.StdOut.Write("Do you wish to Display all of the IP Addresses (Y/N) .... ") ans = WScript.StdIn.Readline() If ans <> "Y" and ans <> "y" and ans <> "N" and ans <> "n" Then WScript.StdOut.WriteLine(chr(7) & chr(7) & "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 room = 0 to 5 for computer = 0 to 3 WScript.StdOut.WriteLine (vbCrLf & "The IP Address in Room " & room+100 & " for Computer " & computer+1 & " is " & ipAddress(room,computer)) Next Next End If
COMP230_W4_IP_Array_Report.docx
In the space provided below, copy and paste the RUN of your VBScript program:
cscript ip_array.vbs Process started >>> Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Please Enter the Room Number (100-105) ...... 111 __Error, 100 to 105 Only!!! Please Enter the Room Number (100-105) ...... 104 Please Enter the Computer Number (1-4) ...... 6 __Error, 1 to 4 Only!!! Please Enter the Computer Number (1-4) ...... 4 The IP Address in Room 104 for computer 4 is 192.168.10.46 Do you wish to Display all of the IP Addresses (Y/N) .... y The IP Address in Room 100 for Computer 1 is 192.168.10.11 The IP Address in Room 100 for Computer 2 is 192.168.10.12 The IP Address in Room 100 for Computer 3 is 192.168.10.13 The IP Address in Room 100 for Computer 4 is 192.168.10.14 The IP Address in Room 101 for Computer 1 is 192.168.10.19 The IP Address in Room 101 for Computer 2 is 192.168.10.20 The IP Address in Room 101 for Computer 3 is 192.168.10.21 The IP Address in Room 101 for Computer 4 is 192.168.10.22 The IP Address in Room 102 for Computer 1 is 192.168.10.27 The IP Address in Room 102 for Computer 2 is 192.168.10.28 The IP Address in Room 102 for Computer 3 is 192.168.10.29 The IP Address in Room 102 for Computer 4 is 192.168.10.30 The IP Address in Room 103 for Computer 1 is 192.168.10.35 The IP Address in Room 103 for Computer 2 is 192.168.10.36 The IP Address in Room 103 for Computer 3 is 192.168.10.37 The IP Address in Room 103 for Computer 4 is 192.168.10.38 The IP Address in Room 104 for Computer 1 is 192.168.10.43 The IP Address in Room 104 for Computer 2 is 192.168.10.44 The IP Address in Room 104 for Computer 3 is 192.168.10.45 The IP Address in Room 104 for Computer 4 is 192.168.10.46 The IP Address in Room 105 for Computer 1 is 192.168.10.51 The IP Address in Room 105 for Computer 2 is 192.168.10.52
COMP230_W4_IP_Array_Report.docx
The IP Address in Room 105 for Computer 3 is 192.168.10.53 The IP Address in Room 105 for Computer 4 is 192.168.10.54 <<< Process finished. ================ READY ================