Essay Comp230 W2 Ilab

1108 Words5 Pages
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…show more content…
e 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 Copy your PopUpWindow.vbs program from NotePad++ and paste it into the space provided below: Capture the PopUpWindow.vbs Run (using <Alt><PrtSc> to capture the PopUp Window on the desktop) and copy it into the space provided below: ' VBScript: CmdArgs.vbs ' Written by: ' Date: 5/16/2013 ' Class: Comp230 ' Professor: Giao Dau ' ===================================== ' Check for Command Line Arguments Set args = WScript.Arguments If args.Count < 2 Then WScript.Echo "You must enter the name age as Command Line Arguments!!" WScript.Sleep(5000) WScript.Quit End If ' Assign name and age variables to Cmd Line Args name = args.item(0) ageStr = args.item(1) ' 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: CmdArgs.vbs ' Written by: ' Date: 5/16/2013 ' Class: Comp230 ' Professor: Giao Dau

    More about Essay Comp230 W2 Ilab

      Open Document