Zahid iLab5 - Date:08/07/2011 Name:ZeeshanZahid LabNumber:5

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

View Full Document Right Arrow Icon
Date: 08/07/2011 Name: Zeeshan Zahid Lab Number: 5 Exercise # 1 Source Code and Screen Shot of the output  (10 Points) 'programmer: Zeeshan Zahid 'created on 8/07/2011 'purpose: demonstrates how to use counters and accumulators option explicit dim theCount dim theSum dim userInput userInput=int(inputbox("enter a number (-1 to exit):")) do while userInput > 0 theSum=theSum + userInput theCount=theCount + 1 userInput=int(inputbox("enter a number (-1 to exit):")) loop do while userInput > 0 if userInput >= 60 AND userInput <=100 then theCount=theCount+1 end if userInput = int(inputbox("enter a number (-1 to exit):")) loop wscript.echo "the number of enteries between 60 and 100 is "& theCount
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Exercise # 2 Source Code and Screen Shot of the output  (10 Points) 'programmer: Zeeshan Zahid 'created on 8/07/2011 'purpose: demonstrates how for-loops function and how to selective print ranges of numbers using AND/OR logic option explicit dim nmbrsToPrint,LCV,formatCode,formatCodea formatCode=VBCR 'initialize the formatCode variable formatCodea=VBCR for LCV=40 to 67 if (LCV>=40 AND LCV<=47) OR (LCV>=50 AND LCV<=57) OR (LCV>=60 AND LCV<=67) then 'accumulate the output to a variable 'change the format code used if formatCode=VBCR then formatCode=VBTAB else formatCode=VBCR if formatCodea=VBCR then formatCodea=VBTAB else formatCodea=VBCR end if end if
Background image of page 3

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

View Full DocumentRight Arrow Icon
end if next wscript.echo nmbrsToPrint Exercise # 3 Source Code and Screen Shot of the output  (10 Points) option explicit
Background image of page 4
Image of page 5
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 / 7

Zahid iLab5 - Date:08/07/2011 Name:ZeeshanZahid LabNumber:5

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online