Program 1:Simple VB Script Programs
Aim:
To write a VB Script program to implement simple programs
1: Display a Welcome Message
Algorithm:
1. Start
2. Show message box: "Welcome to VBScript Programming!"
3. End
2: Add Two Numbers
Algorithm:
1. Start
2. Prompt the user to enter the first number → store in `num1`
3. Prompt the user to enter the second number → store in `num2`
4. Convert both inputs to integers
5. Add `num1` and `num2` → store the result in `sum`
6. Show the result using a message box: "The sum is: [sum]"
7. End
3: Check Even or Odd
Algorithm:
1. Start
2. Prompt the user to enter a number → store in `num`
3. Convert input to integer
4. If the number is divisible by 2 (i.e., `num Mod 2 = 0`):
- Show message: "[num] is Even."
5. Else:
- Show message: "[num] is Odd."
6. End
4: Countdown from 5 to 1
Algorithm:
1. Start
2. Set counter `i = 5`
3. While `i >= 1`
- Show message: "Starting in: [i]"
- Decrease `i` by 1
4. After loop, show message: "Go!"
5. End
Result:
Thus,the VB Script program to implement simple programs have been successfully executed and
their outputs verified.
Program 2: Grade Calculation Using Array
Aim:
To write a VB Script program to implement student grade calculation using array
Algorithm:
1. Start
2. Declare an array `scores` of size 5 to store marks for 5 subjects
3. Declare variables: `total = 0`, `average`, `index`, `grade`, and `gradeScale`
4. Set `gradeScale` as an array: ["F", "E", "D", "C", "B", "A", "S"]
5. **For** each subject `i` from 0 to 4:
- Ask user to enter marks for Subject (i+1)
- Convert the input to integer and store in `scores(i)`
- **While** the mark is less than 0 or greater than 100:
- Ask user again to enter valid marks
- Add the score to `total`
6. After the loop, calculate average as:
`average = total / 5`
7. Based on the average, determine the grade `index` from (0 to 6 ) using if,elseif and else
statements.
8. Set `grade = gradeScale(index)`
9. Display the result in a message box:
- Show average (rounded to 2 decimals)
- Show corresponding grade
[Link]
Result:
Thus,the VB Script program to implement student grade calculation using array have been
successfully executed and it' s outputs verified.
Program 3: Email Validator Using Function
Aim:
To write a VB Script program to implement Email Validator using function
Algorithm:
1. Start
2. Define a function `IsValidEmail(email)`
- Check if email contains **"@"** and **"."**
- Make sure `"."` comes **after** `"@"`
- If both conditions are true: return **True**
- Else: return **False**
3. Ask the user to enter an email address → store in `email`
4. Call the `IsValidEmail(email)` function
- If result is **True** → Show message: "Valid email address!"
- Else → Show message: "Invalid email!"
5. End
Result:
Thus,the VB Script program to implement Email Validator using function have been successfully
executed and it' s outputs verified.
Program 4: Password Strength Checker Using String
Aim:
To write a VB Script program to implement Password Strength Checker Using String
Algorithm:
1. Start
2. Define a function `CheckPasswordStrength(password)`
3. Inside the function:
- Set flags: `hasUpper`, `hasLower`, `hasNumber`, `hasSpecial` → all False
- If password length is less than 8 → return "Weak (Too short)"
4. Loop through each character in the password:
- If character is uppercase → set `hasUpper` to True
- If character is lowercase → set `hasLower` to True
- If character is a number → set `hasNumber` to True
- If character is a special symbol → set `hasSpecial` to True
5. After the loop:
- If all 4 types are present → return "Strong"
- If at least upper, lower, and number are present → return "Moderate"
- Else → return "Weak"
6. Ask user to enter a password
7. Call `CheckPasswordStrength` with the entered password
8. Show the result using a message box
9. End
Result:
Thus,the VB Script program to implement Password Strength Checker Using String have been
successfully executed and it' s outputs verified.