0% found this document useful (0 votes)
28 views5 pages

VB Interview QUESTIONS.

Uploaded by

Ashwin jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views5 pages

VB Interview QUESTIONS.

Uploaded by

Ashwin jha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

VBSCRIPT INTERVIEW QUESTIONS:

1. Differences between Programming Languages and Scripting Languages


2. What is variable?
3. What are the Rules for naming the variables?
4. How to Declaration of a variable?
5. What are Types of Declaration?
6. What is CONSTANTS?
7. What is DATATYPES?
8. What is Typename?
9. List of subtypes
1) Empty 2) Integer 3) Long 4) Double 5) String 6) Boolean 7) Date 8) Array 9) Object 10) Err

10. Write a script which accepts p, t, r from the user & compute the Simple Interest
11. Write a script which accepts two numbers and prints the sum and product of these numbers
12. Write a VB script to accept 1st name, middle name and last name in separate input boxes and
display the output as shown below,
13. Write a VB script to accept first name, last name, age and date of birth of a user and display the
output as shown below,

CONTROL STATEMENTS AND LOOPS:


Different types of Control statements are,
1) IF statements
2) SELECT . . . CASE statements
3) Loops
 FOR . . . NEXT loop
 FOR EACH . . . NEXT loop
 Do . . . LOOP While
 Do While . . . loop
 Do . . . until WHILE
 Do UNTIL . . . loop
 WHILE . . . WEND

1. Write a VB script to accept a number and check whether it is an odd number


2. Write the program to find the greatest of two numbers by using if else statement
3. Write a program to find the odd and even number and print if the number is odd or even
4. Write a program to find the greatest between two numbers or if the numbers are equal,
5. Write a Program to accept three numbers and print the highest among them,
6. Write a program to accept three numbers and print the least among them
7. Write a program to accept 4 numbers and print the highest among them
8. Write a VB script to compute electricity billing amount with the help of following requirements,
a) Number of units consumed should be entered
b) Cost per unit is shown below,
c) 1st 100 units – Rs 2 / unit
d) Next 100 units – Rs 4 / unit
e) Remaining is – Rs 6 / unit
f) c) any outstanding amount (arrears) should be entered
g) a fine of 3% on outstanding amount should be added
9. Accept two numbers and find out whether the 1 st one is greater than the 2nd number. If the 1st
one is greater, then accept another number and compare both of them
10. Write a VB script to design a calculator application using select case.

11. Write a script to print all the odd and even numbers in a separate msgbox (from 1 to 20)
12. Write a VB script to print all the odd numbers between 100 to 200 in a single msgbox
13. Display the 1st 20 even numbers between 400 to 300
14. use do loop to compute the factorial of a number and continue if needed for more executions
15. Write a script to print 1 to 10 numbers using do – while in a single messagebox
16. Write a script to print 1st 10 even numbers between 200 to 300 in a single messagebox using
do – while loop
17. Write a program for finding out whether the given year is a leap year or not?

18. Read two numbers and display the sum?


19. Read P,T,R values and Calculate the Simple Interest?
20. Read Four digit number, calculate & display the sum of the number or display Error message if
the number is not a four digit number?
21. Read any Four digit number and display the number in reverse order?
22. Read 4 subjects marks; calculate the Total marks and grade?

(a) If average marks Greater than or equal to 75, grade is Distinction

b) If average marks Greater than or equal to 60 and less than 75 , then grade is First

c) If average marks Greater than or equal to 50 and less than 60 , then grade is Second

d) If average marks Greater than or equal to 40 and less than 50 , then grade is Third

23. Display Even numbers up to n?

PATTERN MATCHING
1. Display a picture as shown below,

*
* *
* * *
* * * *
2. Display a picture as shown below,

* * * *
* * *
* *
*
3.Display the picture shown below

1
1 1
1 1 1
1 1 1 1

4.Display the picture shown below,

* * * *
* * * *
* * * *
* * * *

37.Display the picture as shown below


1
1 2
2 234

ARRAYS
1. Accept 5 numbers from an array and print the sum of them
2. Accept 5 numbers from an array and print them in the reverse order
3. DIFFERENCES between FOR & FOR EACH
1. Write a program to print a 2 * 2 matrix (2 rows, 2 columns)
2. Write a Program to print a matrix and also its transpose
3. VB Script to add 2 matrices
4. Accept ‘n’ numbers from the user & print the sum of them. Make use of ‘for each’ loop
5. Write the same program shown above making use of ‘UBOUND’ in FOR loop
6. Accept some of the city names from the user. Also accept the delimiter from the user that
separates each of the city names. Print each of the city names in separate message boxes using
SPLIT function.
7. Differences between FUNCTION & SUBROUTINE
8. Write a function to compute Simple Interest
9. Write a function to check whether the number is prime or not
10. Accept a string and display a message if the string is not having atleast 5 characters
11. Accept a string and print whether letter ‘A’ is present in it.
12. Accept 5 numbers & store in a array. Display highest among them
13. Accept a string & check if it is a palindrome or not
14. Accept 2 strings & print which is the greatest. If they are same, display the message accordingly

FSO
52.Write s program to Create a Folder
53. Write a VB Script to check if a folder exists or not
54. Write a VB Script to copy a folder from 1 location to another location
55.Accept a drive name (drive letter) & print the total size of it
56.Accept a folder name & display the date of creation, its name & total size of it
57. Write a Program to rename a new folder
58. Write a Program to display the drive name, free space & total size of it
59. Write a VB Script to open a file & perform basic read operations
60. Write a VB Script to read all the contents of a file & print each of the line in a separate msgbox
61. WRITE a script to enter some strings in a given file

EXCEL Operations
62. Write a VB Script to perform basic read operations from an excel file
63. Write a VB Script to perform basic write operations
64. Write a VB Script to set the font properties
65. Write a VB Script to generate all the color(s) between 1 to 56 in an Excel sheet
66. Write a VB Script to copy from 1 excel sheet to another

ASSIGNMENT PROGRAMS

1) Enhance program in PAGE 70 to check the existence of the given folder before creating it. If it exists -
then dont create the folder & display a message that folder already exists.

2) Modify the program in Page 70 to allow the copy only if the source folder is existing

3) Write a script to rename a folder (make use of 'move folder')

4) Write a script to create a text file & print if it is successfully created or not
vfso.createtextfile "C:\temp.doc"

5) Write a script to display an output as show below for a given drive in a single msgbox,
Drive Name C
Total size X GB
Used space Y GB
Free space Z GB

6) For a given file, display the properties as shown below,


File name - test.txt
File type - text document
Total Size - X kb
Date of creation
date of last access

in page 73,

6) Script to print the total number of characters & lines in a file

7) Script that copies 1st 10 lines of a file to another file


8) Script to display the contents of a file in the reverse order

9) Script to copy the contents of a file from 1 to another file without using copy file method

10) Script to copy all the contents of 1 sheet to another sheet


There are 2 columns in 1st sheet. use i,j concept - nested for loops.
The above changes should be saved in a new file

11) Write a script to handle array out of range error

12) Write a script to handle file not found & path not found error

You might also like