Está en la página 1de 22

Nombre:

Jorge Vicente Mejia Solorzano


Licenciado:

Ing. Stalin Rodrguez


Materia:

Desarrollo de funciones en el sistema informtico


(DFSI)
Tema:

Programas en Software libre Gambas


Paralelo:

3RO A Sistemas
Ao Lectivo:

2014-2015

CADENA DE TEXTO
1) QUE MUESTRE EN CONSOLA UNIDAD EDUCATIVA
HUGO CRUZ ANDRADE EL CARMEN- MANABIECUADOR
Public Sub Main ()
Dim Institucin as String
Dim Cantn as String
Dim Provincia as String
Dim Pas as String
Institucin=UNIDAD EDUCATIVA HUGO CRUZ ANDRADE
Cantn=EL Carmen
Provincia=Manab
Pas=Ecuador
Print Institucin
Print cantn &_ Provincia & _ & Pas
UNIDAD EDUCATIVA HUGO CRUZ ANDRADE
El Carmen Manab Ecuador

2) INGRESAR 3 NOTAS SACAR LA SUMA Y


CALCULAR LA SUMA DEL PROMEDIO
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 Primera Nota
Input n1
Print Ingrese la Segunda Nota
Input n2
Print Ingrese la Tercer Nota
Input n3
S= n1+n2+n3
P= s/3
Print la suma es:
Print s
Printel promedio es: & p
End

3) CREAR UN PROGRAMA QUE PERMITA LEER LA


CANTIDAD Y EL PRECIO DE UN PRODUCTO, EL
MISMO QUE TIENE UN DESCUENTO DEL 5%
MOSTRAR POR PANTALLA EL PRECIO TOTAL.
Public Sub Main ()
Dim cantidad as Single
Dim precio as Single
Dim subt as Single
Dim des as Single
Dim prt as Single
Dim producto as String
Print Bienvenidos 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 cantidad
Subt= cantidad*precio
Des=subt*0,05%
Prt=subt-des
Print el precio total del producto ser;
Print prt
End

4) REALIZAR UN PROGRAMA QUE PERMITA


REALIZAR LA SUMA DE DOS VALORES
Public Sub Main ()
Dim A as Byte
Dim B as Byte
Dim S as Byte
A= 10
B= 5
S= A+B
Print La suma es:, 5

5) EJERCICIO PARA MOSTRAR LA MULTIPLICACION,


LA DIVISIN, LA SUMA Y RESTA DE DOS NMEROS.

Public Sub Main ()


Dim S as Integer
Dim P as Integer
Dim O as Integer
Dim A as Integer
S= 10
P=15
O=40
Print S+P
Print O-O
Print S*O
Print P/O
End

6) REALIZAR UN PROGRAMA QUE INGRESE TODAS


LAS OPERACIONES MATEMTICAS.
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

7) EXPORTACIN: EL ECUADOR EXPORTA CAF,


CACAO Y MAZ EN QUINTALES SE DESEA CALCULAR
EL TOTAL DE EXPORTACIONES Y EL PORCENTAJE
DE CADA PRODUCTO EXPORTANDO, CON LOS
SIGUIENTES DATOS MAZ 300, CAF 400, CACAO 800.
Public Sub Main ()
Dim C as Integer
Dim CA as Integer
Dim M as Integer
Dim P1 as Single
Dim P2 as Single
Dim P3 as Single
Dim T as Integer
C= 800
CA= 400
M= 300
T= C+CA+M
P1= (C/T)*100
P1= (CA/T)*100
P1= (M/T)*100
Print el total de las exportaciones es:&T
Print el porcentaje del cacao es:&P1&%
Print el porcentaje del caf es:&P2&%
Print el porcentaje del maz es:&P3&%
End

8) REALIZAR UN PROGRAMA QUE CALCULE EL IVA


DE UN PRODUCTO POR PANTALLA SE DEBE
MOSTRAR EL IVA.
Public Sub Main ()
Dim Iva as Single
Dim S as Single
Print ingrese el valor
Input Iva
S=Iva*12/100
Print el Iva es:S
End

9) REALICE UN PROGRAMA QUE CALCULE EL REA


DE UN TRINGULO TENIENDO COMO DATOS DE
ENTRADA LA BASE Y LA ALTURA.
Public Sub Main ()
Dim b as Single
Dim a as Single
Dim rea as Single
Print Este programa es para calcular el rea, la base y la
altura de un tringulo;
Print Ingrese la base del tringulo que desea calcular su
rea;
Input b
Print Ingrese la altura del tringulo que desea calcular su
rea;
Input a
rea= (b*a)/2
Print El rea del tringulo es este;
Print rea
En

10) REALICE UN PROGRAMA QUE PERMITA RECIBIR


COMO DATO DE ENTRADA UNA DISTANCIA MEDIDA
EN METROS Y LA CONVIERTA A KILMETROS.
Public Sub Main ()
Dim metro as Single
Dim kilometro as Single
Print Ingrese la medida en metro;
Input metro
Km=metro/100
Print La medida ingresada en metros convertida en
kilmetros es ;
Print El valor en metros convertida en km es:&km
End

11) RESOLVER LA SIGUIENTE ECUACIN Y=X3-X2+23


Public Sub Main ()
Dim x as Integer
Dim e as Integer
X=3
y=x^3-x^2+2-3
Print El Resultado de la ecuacin es;
Print y
3^3-3^2+2-3
End

12) CREAR UN PROGRAMA QUE CALCULAR EL


SALARIO SEMANAL DE UN EMPLEADO AL QUE SE LE
PAGA $5 POR HORA Y TRABAJA 8 HORAS DIARIAS
DE LUNES A VIERNES.
Public Sub Main ()
Dim Salario as Single
Dim Horas as Single
Dim Total as Single
Salario=5
Horas=8
Total=Salario*Hora*5
PrintEl salario semanal del empleado es:
Print total
End

13) EN UN SALN DE CLASE EXISTEN 42 ALUMNOS


LA CUAL QUE ESTN DIVIDIDOS EN 30 MUJERES Y
12 VARONES, SE NECESITAN SABER CUL ES EL
MAYOR PORCENTAJE DE AMBOS.
Public Sub Main ()
Dim Mujeres as Integer
Dim Varones as Integer
Dim Suma as Integer
Dim por1 as Integer
Dim por2 as Integer
Mujeres=30
Varones=12
Suma=Mujeres +Varones
Por1=Mujeres/Suma*100
Por2=Hombre/Suma*100
PrintEl porcentaje de Mujeres y Varones en el saln:
Print Mujeres:&por1&%
PrintHombres:&por2&%
End

14) CREAR UN PROGRAMA QUE PERMITA LEER LA


CANTIDAD Y EL PRECIO DE UN PRODUCTO , EL
MISMO QUE TIENE UN DESCUENTO DEL 5%
MOSTRAR POR PANTALLA EL PRECIO TOTAL.
Public Sub Main ()
Dim cantidad as Single
Dim precio as Single
Dim Subt as Single
Dim Desc as Single
Dim Prt as Single
Dim producto as Single
Print Bienvenidos 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
Subt=cantidad*precio
Desc=Subt*0,05%
Prt=Subt-Desc
Print El precio total del producto ser;
Print Prt
End

15) APLICAR UN SELECT CASE PARA DETERMINAR EL


DESCUENTO QUE SE OTORGA EN LAS PRXIMAS
COMPRAS A UN CLIENTE HABITUAL. DICHO CLIENTE
CUENTA CON TARJETA DE CRDITO DE LA TIENDA
RETAIR Y EL DESCUENTO EST RELACIONADO AL
MONTO DE SU FACTURACIN DEL MES DE ENERO:
SE CONSIDERA CUATRO NIVELES DE FACTURACIN.
MONTO FACTURADO
450
150 Y < = 450
150 Y < = 300
< 150

DESC. PROXIMA COMPRA


40%
30%
20%
10%

Public Sub Main ()


Dim Monto as Integer
Dim Descuento as Integer

Select Case Monto


Case 0+0 to 150
Descuento=10
Case 151 to 300
Descuento=20
Case 301 to 450
Descuento=30
Case >450
Descuento=40
Case Else
Print Error
End Select
Print El descuento otorgado es &descuento&%
End

16) INGRESE 3 VALORES E INDIQUE CUAL ES EL


MAYOR.

A
15

B
10

Public Sub Main ()


Dim A as Integer
Dim B as Integer
Dim C as Integer

Print Ingrese el valor de A;


Input 15
Print Ingrese el valor de B;
Input 5
Print Ingrese el valor de C;
Input 10
If A>B AND A>C
Print Mayor es A
Else
If B>A AND B>C
Print Mayor es B
Else
If C>A AND C>B
Print Mayor es C
Else
Print Error
End If
End

C
5

17) INGRESE TRES VALORES Y MUESTRE SI ES


POSITIVE, NEGATIVE O NEUTRO.
Public Sub Main ()
Dim Valor as Integer
Print Ingresa el primer valor;
Input Valor
If Valor >0 Then
Print El valor es positivo
Else
If Valor <0 Then
Print El valor es negativo
Else
If Valor ==0 Then
Print El valor es neutro
Else
Print Error
End If
End

18) FORMA DE PAGO: FP

1, 2,03

*Si es 1 el descuento ser 10% del valor.


*Si es 2 ser 15%.
*Si es 3 no habr descuento.
Public Sub Main ()
Dim valor as Single
Dim Fp as Integer
Dim D as Single
Print Ingrese el valor de producto;
Input valor
Print Ingrese la forma de pago;
Input Fp
If Fp==1 then
D=(valor*10)/100
Print El descuento es&D%
Else
Print No hay descuento
End If
End

19) SELECT CASE


9 10
7 8,99
4,01 - 6,99
<=4
Public Sub Main ()
Dim Notas as Single
Print Ingrese las notas
Input Notas
Select Case Notas
Case < =4
Print NAAR
CASE 4, 01 to 6, 99
Print PAAR
Case 7 to 8, 99
Print AAR
Case 9 to 10
Print Error
End Select

Dar
aar
Paar
Naar

20) REALIZA UN PROGRAMA UTILIZANDO LA


SETENCIA FOR PARA MOSTRAR 10 VECES LA
PALABRA AMISTAD.
Public Sub Button1_ click ()
Dim x as Integer
X=1
For x=1 to 10
Listbox 1.add (Amistad)
Next
End

21) REALIZAR UNA APLICACIN QUE IMPRIMA LOS


MULTIPLOS DE 3 HASTA 99.
Public Sub Button_ click ()
Dim N as Integer
N=0
For N=0 to 99 step3
Listbox1.add (N)
Next
End

22) CALCULADORA PERSONAL

CODIGO FUENTE
PUBLIC SUB _new()
END
PUBLIC SUB Form Open()
END
PUBLIC SUB Button1_Click()
END
PUBLIC SUB btnsalir_Click()
ME.close
END
PUBLIC SUB btnlimpiar_Click()
txtprival.text = " "
txtsegval.text = " "
txtresul.text = " "
END

PUBLIC SUB btnsuma_Click()


txtresul.text = txtprival.text + txtsegval.text
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 btndivi_Click()
txtresul.text = txtprival.text / txtsegval.text
END

23) EJERCICIO DE EDAD

Public sub main ()


Dim edad as integer
Edad =txtedad.text
If edad<2 and edad>0 then
Txtresul.text =bebe
Else
If edad<12 then
Txtresul.text =nio
Else
If edad<18 then
Txtresul.text =joven
Else
Txtresul.text =adulto
End if
End if
End if

24) EJERCICIO DE NMERO PAR O IMPAR

Public sub main ()


Dim N as integer
Dim A as integer
Print ingrese un nmero
Input N
N=A mod 2
If=N =A then
Print es par
Else
Print es impar
End if

También podría gustarte