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

Exercise 5

This code defines variables for kilograms and energy, sets the kilograms variable to a textbox value, calculates energy as kilograms times the speed of light squared, displays the energy value in a label, and displays the energy divided by 360,000 in another label.

Uploaded by

api-310300017
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)
63 views

Exercise 5

This code defines variables for kilograms and energy, sets the kilograms variable to a textbox value, calculates energy as kilograms times the speed of light squared, displays the energy value in a label, and displays the energy divided by 360,000 in another label.

Uploaded by

api-310300017
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/ 1

Public Class Form1

Dim KG As Decimal
Dim energy As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
KG = TextBox1.Text
energy = KG * (3.0 * 10 ^ 8) ^ 2
Label4.Text = energy
Label5.Text = energy \ 360000
End Sub
End Class

You might also like