Advertisement
Olkach

COM 155 Week 1 DQ

Oct 30th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1.  
  2. This file of COM 155 Assignment Appendix D contains: Identify Twenty Errors in the Passage Below
  3. Computer Science - General Computer Science
  4.  
  5. VBScript IP File Lab
  6.  
  7.  
  8.  
  9. Objective
  10.  
  11. In this lab, students will complete the following objectives.
  12.  
  13. ·  Create a VBScript program using NotePad++.
  14.  
  15. ·  Write a two-dimensional array of IP addresses to a text file.
  16.  
  17. ·  Read the IP Addresses text file into a script.
  18.  
  19. ·  Append new Room/PC/IP address data to the text file.
  20.  
  21. ·  Use the object Scripting.FileSystemObject.
  22.  
  23.  
  24. Element K Network Connections
  25.  
  26.  
  27.  
  28. For this lab, we will only need to connect to vlab-PC1 . The computer vlab-PC1 is the computer on the left side while vlab-PC2 is on the right. If you leave the cursor on the PC icon for a few seconds, a tool-tip message will appear indicating the hostname of the PC. Open  vlab-PC1 and log in as Administrator with the password password .
  29.  
  30.  
  31.  
  32. Lab Overview
  33. We are going to start our lab with the same two-dimensional array of IP addresses. Rather than accessing this array of IP address using the room and computer index values, we are going to write the array of IP addresses to a Text file named IP_Addresses.csv where each line of the file will contain the Comma Separated Values (CSV) for room #, computer #, IP_Address . We will then write a separate VBScript program that will append four new lines of data that will represent the four computers in the new room 106 to the IP_Addresses.csv file. Lastly, we will open and read the newly appended IP_Addresses.csv and display it contents in a meaningful way.  
  34.  
  35.  
  36.  
  37. 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.
  38.  
  39.  
  40. Task 1: Download and Open IP_ArrayFile_start.vbs in NotePad++
  41.  
  42.  
  43.  
  44. ·  Open NotePad++ and from the menu, select File/Open. Open the file IP_File_start.vbs in the C:\Scripts directory. If you do not see this file, you can download it and extract it from the eCollege Doc Sharing file IP_File_start.zip .
  45.  
  46.  
  47.  
  48. ·  Modify the Programmer Header as needed and Save As the VBScript file as IP_FileWrite.vbs.
  49.  
  50.  
  51.  
  52. ·  The line dim ipAddress(5,3) declare 6x4 two-dimensional array. The 5 and 3 give the maximum index value. Since indices always start at 0, this is a 6x4 array.
  53.  
  54.  
  55.  
  56. ·  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.
  57.  
  58.  
  59.  
  60. ·  The IP address of the third computer in room 104 can be found in the array element or component ipAddress(4,2) . This value is “192.168.10.45” . Look at the array carefully to determine the meaning of the index values.
  61.  
  62.  
  63.  
  64.  
  65. Note : If you need to upload a file into the C:\Scripts directory on vlab-PC1 or download a file from the vlab-PC1 C:\Scripts file, open Windows Explorer (<Win>E). As you can see on the right, your local computer drives (in this case, the C: and D: ) are mapped to file copy and paste (or drag and drop) easy to accomplish.
  66.  
  67.  
  68.  
  69.  
  70.  
  71. Task 2: Add the Code to Write the Array Data to a File
  72.  
  73.  
  74.  
  75.  
  76.  
  77. Pseudocode
  78.  
  79.  
  80.  
  81. Comments
  82.  
  83.  
  84.  
  85.  
  86.  
  87. Define the following constants
  88.  
  89. READ = 1, WRITE = 2, APPEND = 8, ASCII = 0
  90.  
  91. Define the variable fileName and initialize it to
  92.  
  93.   “ IP_Addresses.csv ”
  94.  
  95.  
  96. Define the variable ipAddrStr
  97.  
  98.  
  99. https://bitly.com/1oIxt1P
  100.  
  101. It is a good idea to begin socializing as soon as possible. Attend orientation events. Most of you are in the same boat and do not know anyone on campus yet. By participating in social activities right away, you will be able to meet others who are in the same boat and looking to make friends.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement