Академический Документы
Профессиональный Документы
Культура Документы
SALESIANA
INGENIERA MECNICA
Programacin
Visual Basic
KEVIN SUQUILLO
MECNICA 2 GRUPO 2
Realizar un programa que lea las coordenadas de los vrtices un tringulo
rectngulo y calcule hipotenusa, permetro, rea. Para el caso del
programa en visual basic dibujar la figura en el formulario.
Cdigo:
Proceso Tringulo_Rectngulo
leer b
Leer h
ar<-(b*h)/2
hip<-rc [(h^2)+(b^2)]
per<-b+h+hip
FinProceso
Demostracin:
Visual studio.
Cdigo:
If (txt_x1.Text = "" And txt_x2.Text = "" And txt_x3.Text = "" And txt_y1.Text
= "" And txt_y2.Text = "" And txt_y3.Text = "") Then
MsgBox("Ingrese los valores")
Else
x1 = txt_x1.Text
x2 = txt_x2.Text
x3 = txt_x3.Text
y1 = txt_y1.Text
y2 = txt_y2.Text
y3 = txt_y3.Text
Dim p1 As Point
Dim p2 As Point
Dim p3 As Point
p1.X = x1
p1.Y = y1
p2.X = x2
p2.Y = y2
p3.X = x3
p3.Y = y3
txt_area.Text = area
txt_perimetro.Text = d1 + d2 + d3
txt_hip.Text = hip
End If
End Sub
Cdigo:
Algoritmo Rectangulo
Leer b
Leer h
per<-2*b + 2*h
ar<-b*h
Escribir "El rea del rectangulo es:", ar
FinAlgoritmo
Demostracin: