AGUSTIN
FACULTAD DE INGENIERA DE PROCESOS
PROGRAMA PROFESIONAL DE INGENIERA
QUIMICA
TRABAJO PRACTICO
MODELAMIENTO Y
SIMULACION DE PROCESOS
DR. ROLANDO BASURCO CARPIO
PROPIO DE:
MAMANI SALAS DIANA NOELIA CUI:
20120724
TRABAJO N 1
CALCULADORA BASICA
GRUPO: B
08 DE SEPTIEMBRE DEL 2015
AREQUIPA - PERU
ALGORITMO
A continuacin se presenta el algoritmo correspondiente para poder resolver este
proyecto:
Inicio
N1, N2, Sg
Sg=+
Sg= -
S=N1N2
Sg= *
Sg= /
S=N1+
N2
S=N1*
N2
N2=0
No se puede dividir
entre cero
S=N1/
N2
No se proporcion
Sg
Fin
VISUAL BASIC
1. Conceptos bsicos:
Tipos de datos en Visual Basic
El tipo de datos de un elemento de programacin hace referencia al tipo de
datos que puede contener y a cmo se almacenan dichos datos. Los tipos de
datos se aplican a todos los valores que pueden almacenarse en la memoria
del equipo o participar en la evaluacin de una expresin. Cada variable,
literal, constante, enumeracin, propiedad, parmetro de procedimiento,
argumento de procedimiento y valor devuelto por un procedimiento tiene un
tipo de datos.
Elemento de
programacin
Variable
Literal
Constante
Enumeracin
Propiedad
Parmetro de
procedimiento
Argumento de
procedimiento
Tipo de Visual
Basic
Estructura de
tipo Common
Language
Runtime
Boolean
Boolean
En funcin de la
plataforma de
implementacin
True o False
Byte
Byte
1 byte
Char (carcter
individual)
Char
2 bytes
date
DateTime
8 bytes
Decimal
Decimal
16 bytes
0 a +/-
Asignacin de
almacenamiento
nominal
Intervalo de valores
79.228.162.514.264.337.593.5
43.950.335 (+/-7,9...
E+28) sin separador decimal;
0 a +/7,92281625142643375935439
50335 con 28 posiciones a la
derecha del decimal;
el nmero distinto de cero ms
pequeo es +/0,00000000000000000000000
00001 (+/-1E-28)
Double (punto
flotante de
precisin doble)
Double
8 bytes
-1,79769313486231570E+308
a -4,94065645841246544E324 para los valores
negativos;
4,94065645841246544E-324 a
1,79769313486231570E+308
Integer
Int32
4 bytes
-2.147.483.648 a
2.147.483.647 (con signo)
Int64
8 bytes
-9.223.372.036.854.775.808 a
9.223.372.036.854.775.807
(9,2...E+18 ) (con signo)
Objeto
Object (clase)
4 bytes en
plataforma de 32
bits
8 bytes en
plataforma de 64
bits
SByte
SByte
1 byte
Int16
2 bytes
Single (punto
flotante de
precisin sencilla)
Single
4 bytes
-3,4028235E+38 a
-1,401298E-45 para los
valores negativos;
1,401298E-45 a
3,4028235E+38 para los
valores positivos
String (longitud
variable)
String (clase)
En funcin de la
plataforma de
implementacin
0 a 2.000 millones de
caracteres Unicode aprox.
UInteger
UInt32
4 bytes
ULong
UInt64
8 bytes
0a
18.446.744.073.709.551.615
(1,8...E+19 ) (sin signo)
User-Defined (estru
ctura)
(hereda
de ValueType)
En funcin de la
plataforma de
implementacin
UShort
UInt16
2 bytes
3. CODIGO:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim N1 As Single, N2 As Single, Sg As String, S As Single, D As Single, P As Single, C
As Single
N1 = TextBox1.Text
N2 = TextBox2.Text
Sg = TextBox3.Text
If Sg = "+" Then
S = N1 + N2
TextBox4.Text = S
Else
If Sg = "-" Then
D = N1 - N2
TextBox4.Text = D
Else
If Sg = "*" Then
P = N1 * N2
TextBox4.Text = P
Else
If Sg = "/" Then
If N2 = 0 Then
TextBox4.Text = "No se puede dividir entre cero"
Else
C = N1 / N2
TextBox4.Text = C
End If
Else
TextBox4.Text = "No consigno signo"
End If
End If
End If
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
End
End Sub
End Class
SUM
MULTIPLICAC
ION
REST
DIVISI
EXCEL VERSION:
1. INTERFACE DEL PROGRAMA:
2. FORMULA UTILIZADA:
=SI(C5="+",C3+C4,SI(C5="-",C3C4,SI(C5="*",C3*C4,SI(C5="/",SI(C4=0,"Nose puede dividir entre
cero",C3/C4),"No se proporciono signo))))
MATLAB:
1. Conceptos bsicos:
GUIDE:
(Graphical User Interface Development Environment) es un entorno de
programacin visual en Matlab para crear GUIs (Graphical User Interfaces).
Tiene las caractersticas bsicas de todos los programas visuales como Visual
Basic o Visual C++.
2. INTERFACE:
En la cual se ingresa:
Global A;
A=str2double(get(hObject, 'String'));
global B;
B=str2double(get(hObject,'String'));
PARA SUMA:
-
CODIGO:
global A;
global B;
S=A+B;
set(handles.edit3,'string',S);
PARA RESTA:
CODIGO:
global A;
global B;
D=A-B;
set(handles.edit3,'string',D);
PARA MULTIPLICACION:
CODIGO:
global A;
global B;
P=A*B;
set(handles.edit3,'string',P);
PARA DIVISION:
CODIGO:
global A;
global B;
C=A/B;
set(handles.edit3,'string',C);