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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Exercise # 2 Source Code and Screen Shot of the output  (10 Points) @echo off Rem programmer:Zeeshan Zahid Rem created on: 7/11/2011
Background image of page 2
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&
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
'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
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
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 Right Arrow Icon
Ask a homework question - tutors are online