Comp230 W2 Ilab

Only available on StudyMode
  • Download(s) : 272
  • Published : May 25, 2013
Open Document
Text Preview
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...
tracking img