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

Codigo de Programacion de Cilindro

The document contains code for calculating cylinder and free fall parameters. For the cylinder code, it contains subroutines to calculate the volume, perimeter, area of two bases, and total area by getting radius and height values from textboxes and performing calculations. For the free fall code, it contains subroutines to calculate maximum height, rise time, descent time, total time, and instantaneous velocity by getting initial velocity and other values and performing physics equations. Both sections include a clear subroutine to empty the textboxes.

Uploaded by

johar
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)
41 views5 pages

Codigo de Programacion de Cilindro

The document contains code for calculating cylinder and free fall parameters. For the cylinder code, it contains subroutines to calculate the volume, perimeter, area of two bases, and total area by getting radius and height values from textboxes and performing calculations. For the free fall code, it contains subroutines to calculate maximum height, rise time, descent time, total time, and instantaneous velocity by getting initial velocity and other values and performing physics equations. Both sections include a clear subroutine to empty the textboxes.

Uploaded by

johar
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

CODIGO DE PROGRAMACION DE CILINDRO

Public Class Form1


Dim areatotal, radio, pi, altura, volumen, perimetro As Single

Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles


PictureBox1.Click
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click
REM calculamos volumen
pi = 3.1416
radio = Val(TextBox1.Text)
altura = Val(TextBox2.Text)
volumen = pi * radio * radio * altura
TextBox3.Text = volumen

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
REM calculamos perimetro
pi = 3.1416
radio = Val(TextBox1.Text)
altura = Val(TextBox2.Text)
perimetro = 4 * pi * radio + 2 * altura
TextBox4.Text = perimetro

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles


Button3.Click
REM calculamos area de dos tapas
Dim area2tapas As Single
pi = 3.1416
radio = Val(TextBox1.Text)
altura = Val(TextBox2.Text)
area2tapas = 4 * pi * radio + 2 * altura
TextBox5.Text = area2tapas
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles


Button4.Click
REM calculamos area total
pi = 3.1416
radio = Val(TextBox1.Text)
altura = Val(TextBox2.Text)
areatotal = 2 * pi * radio * altura
TextBox6.Text = areatotal
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles


Button5.Click
REM aqui limpiamos
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
End Sub
End Class
CODIGO DE PROGRAMACION DE CAIDA LIBRE

Public Class Form1

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles


Button1.Click
REM aqui calculamos la altura maxima
Dim velocidadinicial, alturamaxima, g As Single
g = 9.8

velocidadinicial = Val(TextBox1.Text)

alturamaxima = (velocidadinicial * velocidadinicial) / (2 * g)


TextBox3.Text = alturamaxima

End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
REM aqui calculamos el tiempo de subida
Dim tiempodesubida, velocidadinicial, g As Single
g = 9.8

velocidadinicial = Val(TextBox1.Text)

tiempodesubida = velocidadinicial / g
TextBox4.Text = tiempodesubida
End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles


Button3.Click
REM tiempo de bajada
Dim tiempodebajada, velocidadinicial, g As Single
g = 9.8

velocidadinicial = Val(TextBox1.Text)

tiempodebajada = velocidadinicial / g
TextBox5.Text = tiempodebajada
End Sub

Private Sub Button6_Click(sender As Object, e As EventArgs) Handles


Button6.Click
REM tiempo total
Dim tiempototal, velocidadinicial, g As Single
g = 9.8

velocidadinicial = Val(TextBox1.Text)

tiempototal = 2 * velocidadinicial / g
TextBox6.Text = tiempototal
End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles


Button4.Click
REM aqui calculamos la velocidad final
Dim velocidadinicial, velocidadinstantanea, tiempo, g As Single
g = 9.8

velocidadinicial = Val(TextBox1.Text)
tiempo = Val(TextBox2.Text)

velocidadinstantanea = velocidadinicial - g * tiempo


TextBox7.Text = velocidadinstantanea
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles


Button5.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
End Sub
End Class

You might also like