nexar
TRANSCRIPT
NOMBRE:
Nexar vinicio
Apellido:
Muentes bazurto
CURSO:
3”A”
ESPECIALIDAD:
SISTEMA
ING:
STALIN RODRIGEZ
1. Mostrar nombre de la institución
Public sub main ( )
Dim Institución as string
Dim País as string
Dim Provincia as string
Dim Cantón as string
Institución = “ UNIDAD EDUCATIVA HUGO CRUZ ANDRADE ”
PAIs = “ECUADOR”
PROVINCIA = “MANABI”
CANTON = “EL CARMEN”
Print Institucion
PRINT CANTON & “ - ” & PROVINCIA & “-” & País
End
2. Programa que calcula el promedio de
tres notas
Public sub main ( )
Dim N1 as single
Dim N2 as single
Dim N3 as single
Dim S as single
Dim P as single
PRINT “INGREsE LA PRIMER NOTA”
Input N1
Print “INGREsE LA sEGUNDA NOTA”
Input N2
PRINT “INGREsE LA TERCERA NOTA”
Input N3
S = N1 + N2+ N3
P = S / 3
PRINT “ LA sUMA Es : ”, s
PRINT “EL PROMEDIO Es : ”, P
End
3. Primer programa de cadena de texto
4. Programa que calcula el IVA de un producto por
consola se debe mostrar el IVA
Public sub main ( )
Dim Valor as single
Dim Producto as string
Dim Total as single
PRINT “ ingrese el producto ”
Input Prodructo
PRINT “ingrese el valor ”
Input Valor
Total = (Valor * 12 ) / 100
PRINT “el nombre del producto Es : ” & Producto
PRINT “el valor del iva es: ” & Total
End
Public sub main ( )
Dim Nombre as string
Dim Apellidos as string
NOMBRE = “ MARíA ”
APELLIDOs = “CEDEñO RAMO”
PRINT APELLIDOs & “ , ” & NOMBRE
End
5. Programa que calcule el área de un triángulo
teniendo como datos de entrada la base y la altura
Public sub main ( )
Dim Base as single
Dim Altura as single
Dim Área as single
PRINT “ INGREsE EL altura del triángulo que desea
calcular el area ”
Input Altura
Print “INGREsE LA BAsE DEL triángulo que desea
calcular la el area ”
Input Base
Área = (Altura * Base ) / 2
Total = (Valor * 12 ) / 100
Print “EL áREA DE TRIANGULO Es : ” & Área
End
6. Exportaciones en el ecuador exporta café, cacao y
maíz en quintales se desea calcular el total de
exportaciones y el porcentaje de cada uno. Productos
exportados con los siguientes datos: maíz 300, café 400,
cacao 800
Public sub main ( )
Dim Cacao as integer
Dim Café as integer
Dim Maíz as integer
Dim P1 as single
Dim P2 as single
Dim Suma as integer
Café = 400
Cacao = 800
Maíz = 300
Suma = Café + Cacao + Maíz
P1 = (Café / Suma ) * 100
P2 = (Cacao / Suma ) * 100
P3 = (Maíz / Suma ) * 100
PRINT “EL TOTAL DE ExPORTACIONEs Es : ” & sUMA
PRINT “EL porcentaje DEL CAfE Es : ” & P1 & “ % ”
PRINT “EL porcentaje DEL CACAO Es : ” & P2 & “ % ”
PRINT “EL porcentaje DEL MAíZ Es : ” & P3 & “ % ”
End
7. Programa que permita recibir como dato de entrada
una distancia medida en metros y convertirla a
kilómetros
Public sub main ( )
Dim Metro as single
Dim Kilometro as single
PRINT “ INGREsE LA MEDIDA EN METROs PARA CONVERTIRLA A
kilómetros ”
Input Metro
Kilometro = Metro / 1000
PRINT “LA MEDIDA EN kM Es : ” kILOMETRO
End
8. Programa para resolver la siguiente ecuación y = x3 –
x2 + 2 - 3
Public sub main ( )
Dim x as byte
Dim y as single
PRINT “ REsOLVAMOs LA sIGUIENTE ECUACIóN y = x3 – x2 +2 - 3”
PRINT “sE LE DA EL VALOR A x”
Input x
y = x ^ 3 – x ^ 2 +2 – 3
Print “EL resultado DE LA ECUACIóN Es : ” & y
End
9. Operaciones básicas de matemáticas
Public sub main ( )
Dim B as byte
Dim C as byte
B = 20
C = 65
Print B +C
Print B – C
Print B / C
Print B * C
End
10. La suma de dos valores
Public sub main ( )
Dim A as byte
Dim B as byte
Dim S as byte
A = 20
B = 65
S = A +B
PRINT “LA sUMA Es : ” & s
End
11. Programa que permita leer la cantidad y el precio
de un producto el mismo que tiene un descuento de 5%
mostrar por pantalla el precio total
Public sub main ( )
Dim Cantidad as single
Dim Precio as single
Dim Sud as single
Dim Des as single
Dim Prt as single
Dim Producto as string
PRINT “bienvenido a mi programa”
PRINT “INGREsE EL NOMBRE DEL PRODUCTO”
Input Producto
PRINT “INGREsE LA CANTIDAD DEL PRODUCTO”
Input Cantidad
PRINT “INGREsE EL PRECIO DEL PRODUCTO”
Input Precio
Sud = Cantidad * Precio
Des = Sud * 0.05
Prt = Prt – Des
PRINT “EL PRECIO TOTAL DE PRODUCTO sERá ”
Print Prt
End
12. Programa que calcula el salario de un trabajador
que gana 5 dólares por hora y trabaja 8 horas diarias
Public sub main ( )
Dim Salario as single
Dim Horas as single
Dim Total as single
Salario = 5
Horas = 8
Total = Salario * Horas * Horas
PRINT “el salario semanal del empleado es”
Print Total
End
13. En un aula de clase hay 42 alumnos que esta dividido
en 30 mujeres y 12 varones calcular el porcentaje
Public sub main ( )
Dim Mujeres as integer
Dim Varones as integer
Dim Suma as integer
Dim P1 as integer
Dim P2 as integer
Mujeres = 30
Varones = 12
Suma = Mujeres + Varones
P1 = Mujeres / Suma * 100
P2 = Varones / Suma * 100
PRINT “EL PORCENTAjE DE MUjEREs y VARONEs Es”
PRINT “MUjEREs :” & P1& “%”
PRINT “VARONEs:” & P2 & “%”
End
14. Programa que permite ingresar el valor de un
producto, y el número de unidades del mismo, mostrar
por pantalla el total de importaciones, y también que
muestre la comisión del 15% en consola
Public sub main ( )
Dim N_producto as string
Dim V_producto as single
Dim Unidades as integer
Dim Importacion as single
Dim Comision as single
Dim V_total as single
PRINT “ingrese el nombre de su producto”
Input N_producto
PRINT “INGREsE EL VALOR POR PRODUCTO”
Input V_producto
PRINT “INGREsE LA UNIDADEs DE sU PRODUCTO”
Input Unidades
Importacion = Unidades * V_producto
PRINT “EL TOTAL DE LA IMPORTACIONEs”
PRINT “LA COMIsIóN DEL 15%”
Print Comisión
V_total = Comisión + Importación
PRINT “el total por el producto la venta es :”Print
N_producto & V_total
End
15. Aplicar un select case para determinar el
descuento que se otorga en la próxima compra a un
cliente habitual dicho cliente cuenta con tarjeta d
crédito d la tienda RETAIL y el descuento está
relacionado al monto de su factorización del mas de
enero se considera con cuatro niveles de
factorización
Monto facturado ENERO DESCUENTO DE LA PROXIMA
COMPRA
>450
300y<=450
>150y<=300
<150
40%
30%
20%
10%
Public sub main ( ) Dim des as integer Dim fac as integer ... Select case des Case 0 to 150 Fac = 10 Case 151 to 300 Fac = 20 Case 301 to 450 Fac = 30 Case > 450 Fac = 40 Case else PRINT “PARA LA próxima compra tendrá un descuento DEL: ” PRINT fAC & ”%” End select
16. Promediar Notas De Un X Estudiante.
Promedio
9 - 10 DAR
7 - 8.99 AAR
4.01 - 6.99 PARA
4 < = NAAR
Public Sub Main ( )
Dim A As Single PRINT “INGREsE UN VALOR ” Input A ... Select Case Case A > = 9 Do A < = 10 PRINT “DAR ” Else Case A > = 7 Do A < = 8.99 PRINT “AAR ” Else Case A < = 6.99 PRINT “PAAR ” Else Case A < = 4 PRINT “NAAR ” End Select End
17. Definir Cuál Valor Es Mayor.
A B C
Public Sub Main ( ) Dim A As Integer Dim B As Integer Dim C As Integer PRINT “INGREsE UN VALOR ” Input A PRINT “INGREsE OTRO VALOR ” Input B PRINT “INGREsE UN ULTIMO VALOR ” Input C ... If A > B And A > C PRINT “MAyOR Es A ” If B > C And B > A PRINT “MAyOR Es B ” Else PRINT “MAyOR Es C ” Endif
18. Forma De Pago:1.2,O 3.
Si Es 1 El Descuento Será 10% Del Valor.
Si Es 2 Será 15%.
Si Es 3 No Habrá Descuento.
Public Sub Main ( ) Dim A As Single Dim Fp As Integer Dim Des1 As Single PRINT “INGREsE UN VALOR ” Input A PRINT “INGREsE UNA fORMA DE PAGO ” Input Fp ... If Fp = 1 Then Des1 = (A * 10 )/100 PRINT “EL DEsCUENTO sERA DE : ” Des1 Else If Fp = 2 Then Des1 = (A * 15 )/100 PRINT “EL DEsCUENTO sERA DE : ” Des1 Else PRINT “NO HABRA DEsCUENTO ” Endif
19. Definir El Valor De Un Número: Positivo, Negativo,
Neutro
Public Sub Main ( ) Dim A As Single PRINT “INGREsE UN VALOR ” Input A ... If A > 0 PRINT “POsITIVO ” Else If A < 0 PRINT “NEGATIVO ” Else If A = 0 PRINT “NEUTRO ” Endif
20. Realiza Un Prograza Utilizando La Sentencia For
Para Mostrar 10 VECEs LA PALABRA “AMIsTAD”.
Public Sub Main ( ) Dim Amistad As Integer For A = 1 To 10 Lisbox.Add(Amistad) Next
21. Realizar Una Aplicación Que Muestre Los Múltiplos
De 3 Hasta El 99.
Public Sub Main ( ) Dim B As Integer For B = 3 To 99 Step 3 Lisbox.Add(B) Next
22. Calculadora Basica:
Public Sub _New() End Public Sub Form_Open() End Public Sub Dial1_Change() End Public Sub Radiobutton1_Click() End Public Sub Listbox1_Click() End Public Sub Label2_Mousedown() End Public Sub Label4_Mousedown() End Public Sub Textbox1_Keypress() End Public Sub Button3_Click() End Public Sub Button4_Click() End Public Sub Btnsuma_Click()
Public Sub Button1_Click() End Public Sub Btnlimpiar_Click() TxTPRIVAL.TxT = “” TxTsEGVAL.TxT = “” TxTREsUL.TxT = “” End Public Sub Btnsalir_Click() Me.Close End Public Sub Btnresta_Click() Txtresul.Text = Txtprival.Text - Txtsegval.Text End Public Sub Btnmulti_Click() Txtresul.Text = Txtprival.Text * Txtsegval.Text End Public Sub Btndiv_Click() Txtresul.Text = Txtprival.Text / Txtsegval.Text End Public Sub Txtsegval_Keypress() End
Txtresul.Text = Txtprival.Text + Txtsegval.Text End
23. Aplicación Para La Edad:
Para Realizar Esta Aplicacion Utilizamos De La Caja De Herramientas:
1. Label
2. Textbox
3. Botton
Public Sub _New()
End
Public Sub Form_Open()
End
Public Sub
Label4_Mousedown()
End
Public Sub
Label3_Mousedown()
End
Public Sub
Btnejecutar_Click()
Dim Edad As Integer
Edad = Txtedad.Text
If Edad < 2 And Edad > 0
Then
TxTREsUL.TExT = “BEBE..”
Else
If Edad < 12 Then
TxTREsUL.TExT = “NIñO..”
Else
Endif
Endif
End
Public Sub
Btnlimpiar_Click()
TxTNOMBRE.TExT = “”
TxTEDAD.TExT = “”
TxTREsUL.TExT = “”
End
Public Sub
Btnsalir_Click()
Me.Close
End
24. Par O Impar:
Public sub _new()
End
Public sub form_open()
End
Public sub button3_click()
End
Public sub btnlimp_click()
TxTNUMERO.TExT = “”
End
Public sub btnsalir_click()
Me.close
End
Public sub btnejecut_click()
Dim numero as integer
Dim a as integer
Numero = txtnumero.text
A = numero mod 2
If a <= 0
MEssAGE(“PAR”)
Else
MEssAGE( “IMPAR”)
Endif