Zahid iLab6

# Zahid iLab6 - Date:08/11/2011 Name:ZeeshanZahid LabNumber:6

This preview shows pages 1–6. Sign up to view the full content.

Date: 08/11/2011 Name: Zeeshan Zahid Lab Number: 6 Exercise # 1 Source Code and Screen Shot of the output  (10 Points) 'Programmer: Zeeshan Zahid 'Created on: 8/11/2011 'Purpose: demonstrate how to create an array and use loops to process array elements ' option explicit 'create an array dim myArray, counter, theOutput myArray = Array(8, 34, 21, 66, 78, 44, 89, 26) 'display the elements in the array in a single message box counter = 0 do while counter <=ubound(myArray) counter = counter + 1 loop 'display the average of the elements in the array function average(theArray) 'returns the average of elements in the array dim i, theSum 'sum the elements for i = 0 to ubound(theArray) theSum = theSum + theArray(i) next 'compute and return the average average = theSum / (ubound(theArray) + 1) end function

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Exercise # 2 Source Code and Screen Shot of the output  (10 Points) @echo off Rem programmer:Zeeshan Zahid Rem created on: 7/11/2011
Rem Creates a text file which lists the operating system, computers name, and current user's name, Rem a listing of the files in the current directory Rem creates a directory and copies the text file into that directory echo operating system %os%>>lab.txt echo computer name %comptuername%>>lab.txt echo user name %username>>lab.txt dir>>lab.txt set MyName = LastName md c:\%MyName% copy lab.txt c:\%MyName&

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Exercise # 3 Source Code and Screen Shot of the output  (10 Points) 'Programmer: Zeeshan Zahid 'Created on: 8/11/2011 'Purpose: Displays computer name, domain name and user name. ' Displays a list of all printer connections option explicit
'output basic netowek information about the user and computer dim wshNetwork set WshNetwork = wscript.createobject("wscript.network") wscript.echo WshNetwork.ComputerName _ & VBCR & WshNetwork.UserName 'List the printers attached to this computer dim PrinterCollection, printerOutput, i set PrinterCollection = WshNetwork.enumPrinterConnections if PrinterCollection.length = 0 then wscript.echo "no printers" else

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/15/2012 for the course COMP 100 taught by Professor Daily during the Spring '08 term at DeVry Addison.

### Page1 / 9

Zahid iLab6 - Date:08/11/2011 Name:ZeeshanZahid LabNumber:6

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online