Sie sind auf Seite 1von 2

Student Name Elijah B Sofowora Class Date

VBScript IPO Lab Report


Copy your NameAge.vbs program from NotePad++ and paste it into the space
provided below:. VBScript: NameAge.vbs
Written by: Elijah B Sofowora
Date: 05/11/17
Class: COMP230
Professor: Professor Aadesh
name =""
ageStr =""
WScript.stdOut.write(Elijah B Sofowora)
name =WScript.stdIn.ReadLine()
WScript.stdOut.Write(28)
ageStr =WScript.stdIn.ReadLine()
Calculte Age+10 and assign to ageStr10
ageStr10 = CStr(CInt(ageStr)+10)
Display Name and Age Values
WScript.StdOut.WriteBlankLines(2)
WScript.StdOut.WriteLine(Elijah & vbTab & vbTab & name)
WScript.StdOut.WriteLine(Elijah & vbTab & vbTab & ageStr)
Wscript.stdOut.WriteLine(vbCrLf & 38 & ageStr10 & vbCrLf)
WScript.StdOut.WriteLine("End of Program")

Capture the NameAge.vbs Run from the console window and copy it into the space
provided below:

Copy your PopUpWindow.vbs program from NotePad++ and paste it into the space provided
below:VBScript: NameAge.vbs
Written by: Elijah B Sofowora
Date: 05/11/17
Class: COMP230
Professor: Professor Aadesh
name ="John Doe"
ageStr ="50"
WScript.stdOut.write(Elijah B Sofowora)
name =WScript.stdIn.ReadLine()
WScript.stdOut.Write(28)
ageStr =WScript.stdIn.ReadLine()
Calculte Age+10 and assign to ageStr10
ageStr10 = CStr(CInt(ageStr)+10)
Display Name and Age Values
WScript.StdOut.WriteBlankLines(2)
msgStr = (Elijah & vbTab & vbTab & name &
vbCrLf &"Elijah & vbTab & vbTab & ageStr & _
(vbCrLf & vbCrLf &38..."& _
WScript.StdOut.WriteLine("End of Program")
One Echo Statement for all ouput
WScript.Echo msgStr
Capture the PopUpWindow.vbs Run (using <Alt><PrtSc> to capture the PopUp Window on the desktop)
and copy it into the space provided below:
Copy your CmdArgs.vbs program from NotePad++ and paste it into the space provided below:
VBScript: NameAge.vbs
Written by: Elijah B Sofowora
Date: 05/11/17
Class: COMP230
Professor: Professor Aadesh
check for command Line Arguments
Set args = WScript.Argumsnts
IF args.Count < 2 then
WScript.Echo
WScript.Sleep(5000)
WScript.Quit
end If
Assign name and age variables to Cmd Line Args
name =args.items(0)
ageStr =args.items(1)
' Calculate Age=10 and assign to ageStr10
ageStr10 =CStr( CInt(ageStr)10)
' Build ouput as a single string msgStr
WScript.stdOut.write(Elijah B Sofowora)
name =WScript.stdIn.ReadLine()
WScript.stdOut.Write(28)
ageStr =WScript.stdIn.ReadLine()
Calculte Age+10 and assign to ageStr10
ageStr10 = CStr(CInt(ageStr)+10)
Display Name and Age Values
WScript.StdOut.WriteBlankLines(2)
msgStr = (Elijah & vbTab & vbTab & name &
vbCrLf &"Elijah & vbTab & vbTab & ageStr & _
(vbCrLf & vbCrLf &38..."& _
WScript.StdOut.WriteLine("End of Program")
One Echo Statement for all ouput
WScript.Echo msgStr
Capture the two CmdArgs.vbs console Runs (one without arguments and one using your name and age
as arguments) and copy the runs into the space provided below:

Das könnte Ihnen auch gefallen