ASSIGMENT DATE TO BE SUBMITTED ON OR BEFORE 27/6/2013
1. Write a VB program to calculate the simple interest of a deposit. If the deposit amount is below 10000, the rate 5%. If the amount is 10000 to 25000, the rate is 8% and 10% for other amounts.The details to be accepted are amount deposited and number of years of deposit. Input and outputmust be accepted/displayed in TextBoxes. The calculation is done when a command button isclicked.
Hint: Simple Interest = P*N*R/100. P-Principal
Amount. N-No.of Years R-Rate of Interest
2. Predict
the output of the following VB code (2)
For a=1 to 10
Print a * a
If a=b Then
Exit for
EndIf
Next a
3. Write
a VB program to accept the marks of 4 subjects of a student and find the total,
percentage and grade.Display the results in separate text boxes. The grade is
to be calculated as follows; above 80% ‘A’, from 50% to80% ‘B’ and below 50%
‘C’.(maximum mark for a subject is 60).
4.
Write
mathematical expressions equivalent to the following VB expressions,
a. ( a + b ) * ( a – b )
b.10 * x ^ 2 + 5 * y ^ 2 + 3
c. (x ^ 2
–b ^ 2)/3 * x ^ 2
5. Differentiate
Do While loop and Do until loop with syntax and example.
6.
Develop
a VB program to find the sum of the First N natural numbers
(Design
the form, set the properties of the control and write the code)
7. Suppose
in a VB project there are four command buttons in a form and each button is
Associated
with event. When we run the program which button’s event will
Executed first? Explain the
corresponding feature of VB
8. What
is output of the following code? Rewrite it using all other loop formats.
Dim I as
integer
I = 10
Do while (
I > 1)
Print i
I= I – 2
Loop
9. Explain Operators in VB?
10. Explain any 4 common events of VB objects
11. Consider
the VB code segment to find the sum of odd numbers upto N.
Private Sub
Command1_Click()
Sum=1
N=val(text1.text)
I=0
Do while
I>N
Sum=Sum+I
Loop
Msgbox Sum
a) Predict the
output of the code?
b) Correct the
errors?
c) Rewrite
the code using for loop?
12.Which property
of form object can be used to set the title bar of a form to “My VBProject”?
13. Consider
the following variable definition. Calculate total memory usage.
Dim A As Integer, B As Long, C As Currency
14. Rewrite
the following Do While Loop using Do Until structure.
A=1
Do While
A<=100
Print A
A = A + 1
Loop
15.Explain the syntax and use of SELECT
statement in VB.
16. Explain the different components of
Visual Basic IDE. (5 scores)
17. Compare Decision Statements in Visual Basic
(5 scores)
18. You
want to change the background color of a command button in Visual Basic. Name the properties that are to be
set for this. (2 scores)
19. Find the output. X=7, y=3 (2)
x/y,
x\y, xmody, x^y
20.
describe any 3 looping statements with syntax.
21. Re-write the
following VB code segment using some other statement without affecting the output.
If n=1 Then
MsgBox “Apple”
ElseIf n=2 Or n=3
MsgBox “Orange”
Else
MsgBox “Grapes”
End If
*********************
No comments:
Post a Comment