You are on page 1of 11

´ UNIVERSIDAD NACIONAL DEL CALLAO

Facultad De Ingeniería Química

FACULTAD DE INGENIERIA QUIMICA

ESCUELA PROFESIONAL DE INGENIRIA QUIMICA

PROGRAMACION DE COMPUTADORAS

 PROFESORA : ESTRADA

 ALUMNA : CALDERON RICAPA GERALDINE LISET

 TEMA : PROBLEMAS DE VECTORES APLICADOS A LA


QUIMICA

 SEMESTRE: 2011A

BELLAVISTA – CALLAO

2011
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

1.- en una planta quimica se tiene q una cantidad de gases contenido en frascos
que logran desplazar cierta distancia al embolo que los presiona, crear un
programa que calcule al ingresar las distancias desplazadas de cada gas la
cantidad de frascos que hay, el mayor desplazamiento, el menor despolazamiento
y el promedio del desplazamiento.

Public Class Form1


Public GAS(99) As Double
Public I, S As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
GAS(I) = TextBox1.Text
ListBox1.Items.Add(GAS(I))
S = S + GAS(I)
I = I + 1
TextBox1.Clear()
TextBox1.Focus()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Dim k, prom, Wmax As Double
Dim Wmin As Double = 99999
k = I - 1
prom = S / I
For I = 0 To k
If GAS(I) > Wmax Then
Wmax = GAS(I)
End If
If GAS(I) < Wmin Then
Wmin = GAS(I)
End If
Next
TextBox2.Text = I
TextBox3.Text = Wmax
TextBox4.Text = Wmin
TextBox5.Text = prom
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
I = 0
S = 0
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
End
End Sub
End Class
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

INICIO

I=0

SI
I > 99
NO

GAS (I)

S = S + GAS (I)

I = I +1

Prom = S/I

I=0

Wmax = 0

Wmin = 9999

SI
I > 99

NO
SI
GAS (I) > Wmax

GAS(I) = Wmax
NO

SI
GAS (I) < Wmin

GAS(I) = Wmin

I = I +1

Prom, Wmax,
Wmin, I

FIN
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

2.- Se tiene las concentraciuones de un determinado grupo de soluciones y


necesitamos hallar el promedio y cuantos de estas soluciones tienen una
concentracion mayor al promedio.

Public Class Form1


Public CON(99), i, s As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
CON(i) = TextBox1.Text
ListBox1.Items.Add(CON(i))
s = s + CON(i)
i = i + 1
TextBox1.Clear()
TextBox1.Focus()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim K, PROM, C As Double
K = i - 1
PROM = s / i
For i = 0 To K
If CON(i) > PROM Then
C = C + 1
End If
Next
TextBox2.Text = PROM
TextBox3.Text = C
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
TextBox2.Clear()
TextBox3.Clear()
i = 0
s = 0

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
End
End Sub
End Class
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

INICIO

I=0

SI
I > 99
NO

CON(I)

S = S + CON (I)

I = I +1

Prom = S/I

I=0

I > 99

NO
SI
CON (I) > Prom

C = C +1
NO

I = I +1

Prom, C

FIN
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

3.- Se requiere hacer un programa el cual nos permita ingresar varias temperaturas
(en mmHg) a las cuales se realiza una reaccion quimica y nos permita hallar la
mayor y la menor presion.

Public Class Form1


Public PRE(99), i As Double

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
PRE(i) = TextBox1.Text
ListBox1.Items.Add(PRE(i))
i = i + 1
TextBox1.Clear()
TextBox1.Focus()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim K, WMAY, POS, POS1 As Integer
Dim WMEN As Integer = 999999
K = i - 1
For i = 0 To K
If PRE(i) > WMAY Then
WMAY = PRE(i)
POS = i
End If
If PRE(i) < WMEN Then
WMEN = PRE(i)
POS1 = i
End If
Next
TextBox2.Text = WMAY
TextBox3.Text = POS
TextBox4.Text = WMEN
TextBox5.Text = POS1
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
i = 0
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
End
End Sub
End Class
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

INICIO

I=0

SI
I > 99
NO

PRE (I)

I = I +1

I=0

I > 99

NO NO

PRE (I) > WMAY

SI

PRE (I) = WMAY

POS = i

NO
PRE (I) < Wmin

SI

PRE (I) = WMAY

POS1 = i

I = I +1

WMAY, WMEN,
POS, POS1

FIN
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

4.- Crear un programa que permita ingresar diferentes densidades de soluciones


cuantas veces se encuentre y luego cuando se ingrese una densidad se pueda
saber cuál es el numero de soluciones que hay con dicha densidad.

Public Class Form1


Public DEN(99) As Double
Public i As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
DEN(i) = TextBox1.Text
ListBox1.Items.Add(DEN (i))
i = i + 1
TextBox1.Clear()
TextBox1.Focus()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim K, C As Integer
Dim VI As Double
K = i - 1
VI = TextBox2.text
For i = 0 To K
If DEN(i) = VI Then
C = C + 1
End If
Next
TextBox3.Text = C
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
TextBox2.Clear()
TextBox3.Clear()

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
End
End Sub
End Class
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

INICIO

I=0

SI
I > 99
NO

DEN (I)

I = I +1

I=0

LEEI “VI”

I > 99

NO
SI
DEN (I) = VI

C = C +1
NO

I = I +1

ESCRIBIR “C”

FIN
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

5.- Realizar un programa que nos permita calcular según los valores de PH cuantos
son básicos, ácidos o neutros, y cuantos valores errados existen, sabiendo que los
valores del PH varían de 0 y 14, y son ácidos aquellos que 0<PH<7, es neutro
cuando PH=7, y básicos cuando 7<PH<14.
Public Class Form1
Public PH (14), i As Double

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
PH(i) = TextBox1.Text
ListBox1.Items.Add(PH(i))
i = i + 1
TextBox1.Clear()
TextBox1.Focus()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim K As Integer
Dim VE, ACI, NEU, BAS As Double
K = i - 1
For i = 0 To K
If PH(i) <= 7 Then
ACI = ACI + 1
ElseIf PH(i) = 7 Then
NEU = NEU + 1
ElseIf PH(i) < 15 Then
BAS = BAS + 1
Else
VE = VE +1
End If
Next
TextBox2.Text = ACI
TextBox3.Text = NEU
TextBox4.Text = BAS
TextBox5.Text = VE
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button3.Click
ListBox1.Items.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
i = 0
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button4.Click
End
End Sub
End Class
´ UNIVERSIDAD NACIONAL DEL CALLAO
Facultad De Ingeniería Química

INICIO

I=0

SI
I > 14
NO

PH (I)

I = I +1

I=0

I > 14

NO NO

0<PH(i) <7

SI

ACI = ACI + 1 SI NO

PH(i) = 7

NEU = NEU + 1
SI NO

PH(i)<= 14

BAS = BAS + 1 VE = VE + 1

I = I +1

ACI. BAS, NEU,


VE

FIN

You might also like