100% found this document useful (2 votes)
2K views6 pages

COMP230 W2 IPO Ereport

The document contains the code for 4 VBScript programs - NameAge.vbs, PopUpWindow.vbs, CmdArgs.vbs, and the output of running those programs. It provides the code for each program to get user input for name and age, then output that information along with calculating age in 10 years. It also captures the output of running each program from the console or by popping up a message window.

Uploaded by

Shanice83
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views6 pages

COMP230 W2 IPO Ereport

The document contains the code for 4 VBScript programs - NameAge.vbs, PopUpWindow.vbs, CmdArgs.vbs, and the output of running those programs. It provides the code for each program to get user input for name and age, then output that information along with calculating age in 10 years. It also captures the output of running each program from the console or by popping up a message window.

Uploaded by

Shanice83
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Student Name

Class

COMP230

Date

VBScript IPO VBox Lab Report


Copy your NameAge.vbs program from NotePad++ and paste it into the space provided below:.
' VBScript: NameAge.vbs ' Written by: ' Date: ' Class: COMP230 ' Professor: name = "Your Name" ageStr = "28" WScript.StdOut.Write("Pleast Enter your Full Name.............. ") name = WScript.StdIn.ReadLine() WScript.StdOut.WriteLine() WScript.StdOut.Write("Please Enter your age ................... ") ageStr = Wscript.StdIn.ReadLine() ageStr10 = CStr( CInt(ageStr)+10 ) WScript.StdOut.WriteBlankLines(2) WScript.StdOut.WriteLine("Your Name is " & vbTab & vbTab & name) Wscript.StdOut.WriteLine("Your Age is " & vbTab & vbTab & ageStr) WScript.StdOut.Writeline(vbCrLf & "Your Age in 10 years is ...... " & _ ageStr10 & vbCrLf) WScript.StdOut.WriteLine("End of Program")

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

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. Pleast Enter your Full Name.............. Your Name Please Enter your age ................... 28 Your Name is Your Age is Your Name 28

Your Age in 10 years is ...... 38 End of Program <<< Process finished. ================ READY ================

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

Copy your PopUpWindow.vbs program from NotePad++ and paste it into the space provided below:
' VBScript: PopUpWindow.vbs ' Written by: ' Date: ' Class: COMP230 ' Professor: name = "John Doe" ageStr = "50" ageStr10 = CStr( CInt(ageStr)+10 ) WScript.Echo WScript.Echo WScript.Echo ageStr10 & WScript.Echo "Your Name is " & vbTab & vbTab & name "Your Age is " & vbTab & vbTab & ageStr vbCrLf & "Your Age in 10 years is ...... " & _ vbCrLf "End of Program"

name = "John Doe" ageStr = "50" ageStr10 = CStr( CInt(ageStr)+10 ) msgStr = "Your Name is " & vbTab & vbTab & name & _ vbCrLf & "Your Age is " & vbTab & vbTab & ageStr & _ vbCrLf & vbCrLf & "Your Age in 10 years will be ...... " & _ ageStr10 & vbCrLf & vbCrLf & "End of Program" WScript.Echo msgStr

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

Capture the PopUpWindow.vbs Run (using <Alt><PrtSc> to capture the PopUp Window on the desktop) and copy it into the space provided below:

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

Copy your CmdArgs.vbs program from NotePad++ and paste it into the space provided below:
' ' ' ' ' VBScript: CmdArgs.vbs Written by: Date: Class: COMP230 Professor:

Set args = WScript.Arguments If args.Count < 2 then WScript.Echo "You must enter the name and age as Command Line Arguments!!" WScript.Sleep(5000) WScript.Quit end If name = args.item(0) ageStr = args.item(1) ageStr10 = CStr( CInt(ageStr)+10 ) msgStr = "Your name is " & vbTab & vbTab & name & _ vbCrLf & "Your age is " & vbTab & vbTab & ageStr & _ vbCrLf & vbCrLf & "Your Age in 10 years will be ...... " & _ ageStr10 & vbCrLf & vbCrLf & "End of Program" WScript.Echo msgStr

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

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:
C:\Scripts>cscript CmdArgs.vbs Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. You must enter the name and age as Command Line Arguments!!

C:\Scripts>cscript CmdArgs.vbs "Your Name" 28 Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Your name is Your age is Your Name 28

Your Age in 10 years will be ...... 38 End of Program

COMP230_W2_IPO_VBReport.docx

Revision Date: 1204

You might also like