Lab Exercise 9 OOP (Inheritance And Polymorphism)
-
Upload
pabburahati -
Category
Documents
-
view
91 -
download
12
Transcript of Lab Exercise 9 OOP (Inheritance And Polymorphism)
![Page 1: Lab Exercise 9 OOP (Inheritance And Polymorphism)](https://reader030.fdocuments.in/reader030/viewer/2022020105/554074d84a795958078b4a76/html5/thumbnails/1.jpg)
QUESTION 1
CODING FOR FORM:
Public Class Form1 Dim obj As New Circle Dim r As Integer Dim h As Integer
Private Sub btnCylinder_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCylinder.Click With obj r = txtRadius.Text h = txtHeight.Text txtKeputusan.Text = Val((2 * 3.142) * r * h) End With End Sub
Private Sub btnCircle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCircle.Click With obj r = txtRadius.Text h = txtHeight.Text txtKeputusan.Text = Val(3.142 * r * r) End With End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click With obj txtRadius.Text = "" txtHeight.Text = "" txtKeputusan.Text = ""
End With
End Sub
Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label3.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub txtRadius_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtRadius.TextChanged
End Sub
Private Sub txtHeight_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtHeight.TextChanged
End Sub
Private Sub txtKeputusan_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtKeputusan.TextChanged
End SubEnd Class
![Page 2: Lab Exercise 9 OOP (Inheritance And Polymorphism)](https://reader030.fdocuments.in/reader030/viewer/2022020105/554074d84a795958078b4a76/html5/thumbnails/2.jpg)
INTERFACE OUTPUT: