Thursday, March 13, 2008

VBScript Assignment 4

DUE: 8/24
This is a comprehensive exercise covering everything we have done in the VBSCript portion of the class.

Declare a variable or constants and assign appropriate values for the following:

a. The title of the window
b. Your name
c. Tomorrow's date
d. Whether it will snow tomorrow
e. The number of TV channels you recieve

1. Accept a number, print it in reverse

E.g. If you accept 274, print
The reverse of 274 is 472

2. Accept two numbers and print:
a. All the even numbers between them
b. All the odd numbers between them
c. All the prime numbers between them

3. Accept two numbers and sum all the numbers between them:

E.g. If you accept 2 and 5 print:
Input values: 2 and 5
Sum (excluding boundaries): 7
Sum (including boundaries): 14

1. Accept a date in mm/dd/yyyy format and
a. Display a message whether the date is valid or not
b. Display the date in parts as:
Month: January
Day: 14
Year: 2008

2. Accept a date and print whether the date is in the past, present or future.

3. Accept a date and print:
a. Day Before: mm/dd/yy
b. Day After: mm/dd/yy

4. Print yesterday's date

1. Accept a word as input and display all the vowels in it.

E.g. if the word is PROFESSIONAL, display:
A : 1
E : 1
I : 1
O : 2
U : 0

2. Accept FirstName, MiddleName and lastName from a user and write code to display this as:
a. LastName, FirstName MiddleInitial.
b. LastName, FirstName
c. FirstInitial. LastName


1. Write a function that takes a String formatted as currency and returns the value as a number.
If you pass the value $1,234,567.70 it returns 1234567.70
If you pass the value 34,567.70 it returns 34567.70

2. Write a function named IsPrime that accepts a number and returns True if the number is prime and False if the number is not.