Comp230 W2 Ilab

Topics: Windows Script Host, VBScript, Internet Explorer Pages: 7 (1120 words) Published: May 25, 2013
Student Name| | Class| Comp230| Date| 5/16/2013|
VBScript IPO VBox Lab Report

' VBScript: NameAge.vbs
' Written by:
' Date: 5/16/2013
' Class: Comp230
' Professor: Giao Dau
' =====================================
'Create name and age variables
name = ""
ageStr = ""
' Prompt User for Name and Age
WScript.StdOut.Write("Please Enter your Full Name ..............") name = WScript.StdIn.ReadLine()
WScript.StdOut.WriteLine() 'Skip 1 line
WScript.StdOut.Write("Please Enter you age .....................") ageStr = WScript.StdIn.ReadLine()
' Calculate Age+10 and assign to ageStr10
ageStr10 = CStr( CInt(ageStr)+10 )
' Display Name and Age Vales
WScript.StdOut.WriteBlankLines(2) 'Skip 2 lines
WScript.StdOut.WriteLine("Your Name is " & vbTab & vbTab & name) WScript.StdOut.WriteLine("Your Age is " & vbTab & vbTab & ageStr) WScript.StdOut.WriteLine(vbCrlf & "You Age in 10 years is ......" & ageStr10 & vbCrlf) WScript.StdOut.WriteLine("End of Program")

' VBScript: NameAge.vbs
' Written by:
' Date: 5/16/2013
' Class: Comp230
' Professor: Giao Dau
' =====================================
'Create name and age variables
name = ""
ageStr = ""
' Prompt User for Name and Age
WScript.StdOut.Write("Please Enter your Full Name ..............") name = WScript.StdIn.ReadLine()
WScript.StdOut.WriteLine() 'Skip 1 line
WScript.StdOut.Write("Please Enter you age .....................") ageStr = WScript.StdIn.ReadLine()
' Calculate Age+10 and assign to ageStr10
ageStr10 = CStr( CInt(ageStr)+10 )
' Display Name and Age Vales
WScript.StdOut.WriteBlankLines(2) 'Skip 2 lines
WScript.StdOut.WriteLine("Your Name is " & vbTab & vbTab & name) WScript.StdOut.WriteLine("Your Age is " & vbTab & vbTab & ageStr) WScript.StdOut.WriteLine(vbCrlf & "You Age in 10 years is ......" & ageStr10 & vbCrlf) WScript.StdOut.WriteLine("End of Program")

Copy your NameAge.vbs program from NotePad++ and paste it into the space provided below:.

Capture the NameAge.vbs Run from the console window and copy it into the space provided below: cscript NameAge.vbs
Process started >>>
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Please Enter your Full Name ..............

Please Enter you age .....................26

Your Name is
Your Age is 26

You Age in 10 years is ......36

End of Program
<<< Process finished. (Exit code 0)
================ READY ================
cscript NameAge.vbs
Process started >>>
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Please Enter your Full Name ..............

Please Enter you age .....................26

Your Name is
Your Age is 26

You Age in 10 years is ......36

End of Program
<<< Process finished. (Exit code 0)
================ READY ================

' VBScript: PopUpWindow.vbs
' Written by:
' Date: 5/16/2013
' Class: Comp230
' Professor: Giao Dau
' =====================================
'Create name and age variables
name = "Jon Doe"
ageStr = "50"
' Calculate Age+10 and assign to ageStr10
ageStr10 = CStr( CInt(ageStr)+10 )
' Buil outut as a single string msgStr
msgStr = "Your Name is " & vbTab & vbTab & name & _ vbCrlf & "Your Age is " & vbTab & vbTab & ageStr & _ vbCrlf & vbCrlf & "You Age in 10 years is ......" & _ ageStr10 & vbCrlf & vbCrlf &"End of Program"

'One Echo Statement for all output
WScript.Echo msgStr
' VBScript: PopUpWindow.vbs
' Written by:
' Date: 5/16/2013
' Class: Comp230
' Professor: Giao Dau
' =====================================
'Create name and age variables
name = "Jon Doe"
ageStr = "50"
' Calculate Age+10 and assign to ageStr10
ageStr10 = CStr( CInt(ageStr)+10 )
' Buil outut as a single string msgStr...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Comp230 wk4 Ilab Essay
  • Comp230 wk 1 ilab Essay
  • Comp230 iLab solutions Essay
  • Essay on ECT122 W2 ILab 3
  • Essay on Documents NETW206 W2 Ilab Report
  • documents NETW360 W2 iLab Report Essay
  • COMP230 Week 4 Essay
  • Essay on Stat 221 week 6 ilab

Become a StudyMode Member

Sign Up - It's Free