{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Zahid iLab5

# Zahid iLab5 - Date Name:ZeeshanZahid LabNumber:5...

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

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

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) '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

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

View Full Document
end if next wscript.echo nmbrsToPrint Exercise # 3 Source Code and Screen Shot of the output  (10 Points) option explicit
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 7

Zahid iLab5 - Date Name:ZeeshanZahid LabNumber:5...

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

View Full Document
Ask a homework question - tutors are online