Comp230 Wk2 Ipo Lab Report

Submitted by: Submitted by

Views: 134

Words: 872

Pages: 4

Category: Science and Technology

Date Submitted: 06/19/2014 04:37 PM

Report This Essay

Student Name | | Class | COMP230 | Date | 5/16/2014 |

VBScript IPO Lab Report

'VBScript: NameAge.vbs

'Written by:

'Date: 5/16/2014

'Class:Comp230

'Professor:

'==========================================

'Create name and age variables

name = "John Smith"

ageStr = "25"

'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 Your Age ..............")

ageStr = WScript.StdIn.ReadLine()

'Calculate Age+10 and assign to ageStr10

ageStr10 = Cstr( CInt(ageStr)+10)

'Display Name and Age Values

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 & "Your Age in 10 years is ......" & _

ageStr10 & vbCrLf)

WScript.StdOut.WriteLine("End of program")

'VBScript: NameAge.vbs

'Written by: Suzannah Ormston

'Date: 5/16/2014

'Class:Comp230

'Professor: Gasko

'==========================================

'Create name and age variables

name = "John Smith"

ageStr = "25"

'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 Your Age ..............")

ageStr = WScript.StdIn.ReadLine()

'Calculate Age+10 and assign to ageStr10

ageStr10 = Cstr( CInt(ageStr)+10)

'Display Name and Age Values

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 & "Your Age in 10 years is ......" & _

ageStr10 & vbCrLf)

WScript.StdOut.WriteLine("End of program")

Copy your NameAge.vbs...