0% found this document useful (0 votes)
50 views

Practical Assignment Demo

The document describes two assignments for creating Visual Basic programs. The first assignment involves building a program with command buttons to perform arithmetic operations by taking user input for two numbers and displaying the result. The second assignment involves building a program to calculate simple and compound interest by taking user input for principal, rate, and time. Both assignments include the form design, coding for the command buttons, and expected output.

Uploaded by

Pranav Shukla P
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Practical Assignment Demo

The document describes two assignments for creating Visual Basic programs. The first assignment involves building a program with command buttons to perform arithmetic operations by taking user input for two numbers and displaying the result. The second assignment involves building a program to calculate simple and compound interest by taking user input for principal, rate, and time. Both assignments include the form design, coding for the command buttons, and expected output.

Uploaded by

Pranav Shukla P
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ASSIGNMENT-1

AIM:-Write a program to perform arithmetic operation using command buttons.

PATH:

DATE:

FORM DESIGN:-

SETTINGS:-

S.NO. CONTROL NAME DESCRIPTION


1. Label-1 ARITHMETIC OPERATION

2. Label-2 Enter first number


3. Label-3 Enter second number
4. Label-4 Result
5. Command 1 Addition

1|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
6. Command 2 Subtraction
7. Command 3 Multiplication

8. Command 4 Division
9. Command 5 Clear
10. Command 6 Exit

CODING:-

Dim a, b, c as integer ‘ Global Declaration


Private Sub Command1_Click()

a = Val(Text1.Text)

b = Val(Text2.Text)

c=a+b

Text3.Text = c

End Sub

Private Sub Command2_Click()

a = Val(Text1.Text)

b = Val(Text2.Text)

c=a-b

Text3.Text = c

End Sub

2|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
Private Sub Command3_Click()

a = Val(Text1.Text)

b = Val(Text2.Text)

c=a*b

Text3.Text = c

End Sub

Private Sub Command4_Click()

a = Val(Text1.Text)

b = Val(Text2.Text)

c=a/b

Text3.Text = c

End Sub

Private Sub Command5_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

End Sub

Private Sub Command6_Click()

Unload Me

End Sub

3|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
OUTPUT:-

4|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
ASSIGNMENT-02

AIM:- WAP to take input of principal, rate & time and calculate simple interest
and compound interest.

FORM DESIGN:

CODING:

Dim si, ci, p, r, t As Integer

Private Sub Command1_Click()

p = Val(Text1.Text)

r = Val(Text2.Text)

t = Val(Text3.Text)

si = p * r * t / 100

Text4.Text = si

End Sub
5|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
Private Sub Command2_Click()

p = Val(Text1.Text)

r = Val(Text2.Text)

t = Val(Text3.Text)

ci = p * (1 + r / 100) ^ t

Text5.Text = ci

End Sub

Private Sub Command3_Click()

Text1.Text = ""

Text2.Text = ""

Text3.Text = ""

Text4.Text = ""

Text5.Text = ""

End Sub

Private Sub Command4_Click()

Unload Me

End Sub

6|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai
OUTPUT:

7|Page
Ms Preeti Jain Assistant Professor Of Computer Science Department of St Thomas College Bhilai

You might also like