Assignemnt 3
1. DECLARATION
--------------
a. Declare variables or constants for the following items
b. Assign appropriate values to the declared variables
Declare a variable or constants and assign appropriate values using functions:
a. Today's Date
b. Whether it will be cloudy tomorrow
c. The price of a book
d. The name of first month of the year
e. Yesterdays date
f. The name of the user logged into your computer
- This will require research
2. Write VBScript code to print the following in a single message box.
*
**
***
**
*
[Note: Do not hardcode the values.]
[Hint: You will need a nested loop]
3. Write a VBScript function that will accept a number and return true if the number is a prime number. False, if the number is not:
Function IsPrime(Byval numInput)
'Your code goes here
End Function
4. Write a VBScript function that when given a filename, it will return the file size.
if the file does not exist, it should return -1.
[Hint: You will need to use the FileSystemObject to answer this]
5. Write a VBScript function that accepts the following input:
123 Fordham Road, Fremont GA 09321
and prints out the following (in 1 message box)
Number: 123
Street: Fordham
City: Fremont
State: GA
Zip: 09321
6. Write a VBScript function that returns the date in MM/DD/YYYY format.
Note that when the day is August 3, 2010, it should display 08/03/2010 and NOT 8/3/2010
Labels: assignment
<< Home