Comp230 week 4 lab vbscript ip array lab

Page 1

COMP230 Week 4 Lab VBScript IP Array Lab

Download here: http://homeworkfox.com/questions/computer-science/11715/comp23


number variables are used as indices for the ipAddress array. · Prompt the user for the room number (100–105). We need to make sure that the user doesn’t enter a value less than 100 or greater than 105. We will use a Do/Loop/While loop to error-handle this value. Look at the pseudocode shown below and write the required VBScript statement that implement the pseudocode task. Real code that is correct as written will be in bold. Do Display Prompt “Please Enter the Room Number (100-105) ...... “ Get StdIn Console Input and assign string value to roomStr (roomStr) If room < 100 OR room > 105Then Use StdOut to Beep Speaker twice with chr(7) and Display ErrMsg “Error, 100 to 105 Only!!!” Skip 1 Line End If Loop While room < 100 OR room > 105 · Now we prompt the user for the computer number (1–4). We need to make sure that the user doesn’t enter a value less than 1 or greater than 4. We will again use a Do/Loop/While loop to error-handle this value. Look at the Pseudocode shown below and write the required VBScript statement that implement this pseudocode task. Real code that is correct as written will be in bold. Do Display Prompt “Please Enter the Computer Number (1-4) ...... “ Get StdIn Console Input and assign string value to compStr (compStr) If computer < 1 OR computer > 4Then Use StdOut to Beep Speaker twice with chr(7) and Display ErrMsg “Error, 1 to 4 Only!!!” Skip 1 line End If Loop Whilecomputer < 1 OR computer > 4 Now that we have a valid room number 100–105 and a valid computer number 1–4, let’s display the IP address for the specified room and computer as follows Display message ” The IP Address in Room ” & room & ” for computer ” & computer & ” is ” & ipAddress(room-100,computer-1) Note: For room 102, Computer 2, the IP Address is found at ipAddress(2,1). How do you convert room 102 to index 2 and Computer 2 to index 1?

Task 3: Prompt User to Display All IP Addresses in Array · Now write the code that follows the pseudocode shown below to prompt the user if they would like to


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.