Está en la página 1de 24

TAREA N° 3

Materia: CIV 275 Lab. de Computación para Ingeniería


Semestre: I/2021
Tema: Estructuras Bucle
Ponderación: 100%
Clases Virtuales: Mediante el Google Classroom

Instrucciones:
El alumno debe entregar la práctica de estructuras Bucle que se pide a continuación hasta el
5 de Octubre de 2021 horas: 14:00 pm.
La tarea debe cargarse en el Google Classroom en un archivo de Word con el siguiente
contenido del programa:

a) Definir el ejemplo de aplicación


b) Diseñar la pantalla o salida de datos
c) Diagrama de flujo en DFD
d) Base de datos para la prueba de escritorio
e) Corrida del Diagrama de flujo DFD
f) Diseño de interfaz en Visual Basic
g) Planilla de Control de propiedades y valores
h) Asignación de propiedades a los controles en Visual Basic
i) Codificación del programa fuente en Visual Basic
j) Corrida y depuración del programa en Visual Basic

Tarea:

a) Definición del programa: Realizar un programa que calcule una ecuación diofánticas
del tipo x²- y² = a usando estructuras Bucle,

El presente programa sirve para resolver ecuaciones Diofánticas del tipo:

x² - y² = a

Como,
x²- y² = (x – y) (x –y ) = a

por ello se descompone a, en un producto de números naturales sean m y n, entonces se tiene


que una solución es:

x = (m + n) / 2
y = (m – n)/ 2

Siempre que x e y sean números naturales.


Ejemplo: Resolución de ecuaciones del tipo x² - y² = a

Termino independiente a = 72

Solución
x y .

9 3

11 7

19 17

b) Diseño de pantalla: Diseñar dos pantallas de acuerdo al siguiente formato:

Pantalla 1

Palla 2
ASIGNACION DE PRACTICAS POR ALUMNO

N° R.U Bucle
Alumno asignado

1 1780223 DO-WHILE
2 1766531 WHILE
3 1788687 FOR
4 1759922 DO-WHILE
5 1780257 WHILE
6 1766547 FOR
7 1780260 DO-WHILE
8 1718282 WHILE
9 1742843 FOR
10 1788704 DO-WHILE
11 1788707 WHILE
12 1788714 FOR
13 1734705 DO-WHILE
14 1759944 WHILE
15 1788731 FOR
16 1813203 DO-WHILE
ASIGNACION DE FORMULAS POR ALUMNO
Private Sub Command1_Click()
Dim H, q, JH As Double
Dim JS, ANG, U As Integer
Dim D, D1, hq As Double
Dim p1, p2 As Double
Dim x1, x2, Xeh, xev As Double
Dim E, E1, E0 As Double
Dim Eh, ev As Double
Dim Pm, MR, MV As Double
Dim FR As Double
Dim ANG1, ANG2, ANG3, ANG4 As Double
Dim PI, CSV, CSD As Double
Dim ANGR, ANGR1, ANGR2, ANGR3, ANGR4 As Double

H = Val(TxtH.Text)
q = Val(Txtq.Text)
JH = Val(TxtJH.Text)
JS = Val(TxtJS.Text)
ANG = Val(TxtANG.Text)
f = Val(txtf.Text)

ANG1 = ANG / 2
ANG2 = 90 + ANG
ANG3 = 90 - ANG1
ANG4 = ANG + ANG1
PI = 3.1416
ANGR = ANG * PI / 180
ANGR1 = ANG1 * PI / 180
ANGR2 = ANG2 * PI / 180
ANGR3 = ANG3 * PI / 180
ANGR4 = ANG4 * PI / 180

S0 = Sin(ANGR)
S1 = Sin(ANGR1)
S2 = Cos(ANGR1)
S3 = Sin(ANGR2)
S4 = Sin(ANGR3)
S5 = Sin(ANGR4)
E1 = 0.5 * JS * (H ^ 2) * ((S3 ^ 2) / (S2 * ((1 + Sqr((S5 * S0) / S2)) ^ 2)))

hq = q / JS
E = E1 * (1 + (2 * (hq / H)))
Eh = E * S2
ev = E * S1

lbls0.Caption = S0
lbls11.Caption = S1
lbls22.Caption = S2
lbls33.Caption = S3
lbls44.Caption = S4
lbls55.Caption = S5

CSV = 2.8
CSD = 1.8

D=H

Do

D1 = D / 3
p1 = JH * H * D1
p2 = 0.5 * JH * H * (2 * D1)
Pm = p1 + p2
x1 = (D1 * 2) + (D1 / 2)
x2 = (D1 * 2) - ((D1 * 2) / 3)
Xeh = H / 3
xev = D
Mp1 = p1 * x1
Mp2 = p2 * x2
Meh = Eh * Xeh
Mev = ev * xev
MR = Mp1 + Mp2 + Mev
MV = Meh
CSV = MR / MV
CSD = Pm * f / Eh
D = D - 0.1

Loop While (CSV >= 2.2) And (CSD >= 1.7)

D = D + 0.1
lblang.Caption = ANGR1
lblp1.Caption = p1
lblp2.Caption = p2
lblx1.Caption = x1
lblx2.Caption = x2
lblev.Caption = ev
lblxev.Caption = xev
lblxeh.Caption = Xeh
lblEh.Caption = Eh
lblpm.Caption = Pm
lblE.Caption = E
LblS1.Caption = S1
LblS2.Caption = S2
lblhq.Caption = hq
lblMp1.Caption = Mp1
lblMp2.Caption = Mp2
lblMeh.Caption = Meh
lblMev.Caption = Mev
lblEh1.Caption = Eh
lblEv1.Caption = ev
lblE1.Caption = E0

LblR1.Caption = q
LblR2.Caption = H
LblR3.Caption = D
LblR4.Caption = MR
LblR5.Caption = MV
LblR6.Caption = Pm
LblR7.Caption = Eh
LblR8.Caption = CSV
LblR9.Caption = CSD
End Sub

------------------------------------------------------------------------------------------

Private Sub Command2_Click()


End
End Sub

------------------------------------------------------------------------------------------

Private Sub TxtANG_KeyPress(KeyAscii As Integer)


'Mueve el puntero a otro cuadro
If KeyAscii = 13 Then
txtf.SetFocus
End If
End Sub

------------------------------------------------------------------------------------------

Private Sub TxtH_KeyPress(KeyAscii As Integer)


'Mueve el puntero a otro cuadro
If KeyAscii = 13 Then
Txtq.SetFocus
End If
End Sub
------------------------------------------------------------------------------------------

Private Sub TxtJH_KeyPress(KeyAscii As Integer)


'Mueve el puntero a otro cuadro
If KeyAscii = 13 Then
TxtJS.SetFocus
End If
End Sub

------------------------------------------------------------------------------------------

Private Sub TxtJS_KeyPress(KeyAscii As Integer)


'Mueve el puntero a otro cuadro
If KeyAscii = 13 Then
TxtANG.SetFocus
End If
End Sub

------------------------------------------------------------------------------------------

Private Sub Txtq_KeyPress(KeyAscii As Integer)


'Mueve el puntero a otro cuadro
If KeyAscii = 13 Then
TxtJH.SetFocus
End If
End Sub

------------------------------------------------------------------------------------------

También podría gustarte