SlideShare a Scribd company logo
1 of 8
PUBLIC SUB MAIN ()
DIM NOMBRE ASSTRING
DIM CANTON ASSTRING
DIM PROVINCIA ASSTRING
DIM PAISASSTRING
NOMBRE= “HUGO B. CRUZ ANDRADE”
CANTON=“EL CARMEN”
PROVINCIA=“ECUADOR”
PRINTNOMBRE & “,” & CANTON “,” & PROVINCIA
END
PUBLIC SUB MAIN ()
DIM A AS BYTE
DIM B ASBYTE
DIM S ASBYTE
A= S
B= 4
S= 9
PRINTS
END
PUBLIC SUB MAIN ()
DIM EDAD ASINTEGER
….
IF EDAD > 20 THEN
PRINT“ADULTO”
ENDFIN
PUBLIC SUB MAIN ()
DIM A AS BYTE
DIM B ASBYTE
DIM S ASBYTE
DIM R ASBYTE
DIM MAS BYTE
DIM D ASBYTE
A=”7”
B= “3”
S= A+B
PRINT“EL RESULTADO DE LA SUMA ES:” S
R= A-B
PRINT“EL RESULTADO DE LA RESTA ES:” R
M= A *B
PRINT“EL RESULTADO DE LA MULTIPLICACION ES:” M
S= A/B
PRINT“EL RESULTADO DE LA DIVISION ES:”D
END
PUBLIC SUB MAIN ()
DIM NOMBRE ASSTRING
DIM APELLIDOSASSTRING
NOMBRE= “MANUEL”
APELLIDOS=“ALVARESGOMEZ”
PRINTAPELLIDOS& “,” & NOMBRE
END
PUBLIC SUB MAIN ()
DIM MAS INTEGER
DIM C ASINTEGER
DIM C1 AS INTEGER
DIM TOTAL ASINTEGER
DIM P1 ASFLOAT
DIM P2 ASFLOAT
DIM P3 ASFLOAT
M= 300
C= 400
C1= 800
TOTAL= M+C+C1
P1= (M/TOTAL) * 100
P2= (C/TOTAL) * 100
P3= (C1/TOTAL) * 100
PRINT”EL TOTAL DE EXPORTACION:”&TOTAL
PRINT“EL PORCENTAJEDE MAIZ:” & P1 & “%”
PRINT“EL PORCENTAJEDE CAFÉ:” &P2 & “%”
PRINT“EL PORCENTAJEDE CACAO:”& P3 & “%”
END
PUBLIC SUB MAIN ()
DIM TOTAL ASFLOAT
DIM PAS STRING
DIM PRECIOASFLOAT
DIM IVA ASFLOAT
PRINT”INGRESEUN PRODUCTO”
INPUT PRODUCTO
PRINT“INGRESE EL PRECIO”
INPUT PRECIO
IVA=PRECIO* 12%
TOTAL= PRECIO * IVA
PRINT“EL IVA DEL PRODUCTO ES:” & IVA
PRINT “EL PRECIO CON EL IVA ES:” & TOTAL
END
PUBLIC SUB MAIN ()
DIM CANTIDAD AS SINGLE
DIM PRECIO AS SINGLE
DIM PRODUCTO STRING
DIM SUBTOTAL SIGLE
DIM PRECIO_TOTAL SINGLE
DIM DESCUENTO AS SINGLE
PRINT “INGRESE LA CANTIDAD”
INPUT CANTIDAD
PRINT “INGRESE EL PRECIO DEL PRODUCTO”
INPUT PRECIO
SUBTOTAL= CANTIDAD * PRECIO
DESCUENTO= SUBTOTAL * 0.05
PRECIO_TOTAL= SUBTOTAL- DESCUENTO
PRINT “EL PRODUCTO INGRESADO ES:” & PRODUCTO
PRINT”EL DESCUENTO ES:” & DESCUENTO
PRINT “EL TOTAL A PAGAR ES:” &PRECIO_TOTAL
END
PUBLIC SUB MAIN ()
DIM PRECIOASSINGLE
DIM CANTIDADASINTEGER
DIM PRODUCTOAS STRING
DIM IMPORTE ASSINGLE
DIM COMISION ASSINGLE
DIM IMPORTE_VENDIDOASSINGLE
PRINT“INGRESE LA CANTIDAD”
INPUT CANTIDAD
PRINT“INGRESE EL PRECIO”
INPUT PRECIO
IMPORTE= CANTIDAD* PRECIO
COMISION=IMPORTO * 0.05
IMPORTE_VENDIDO=IMPORTE + COMISION
PRINT“EL PRODUCTO INGRESADOES:” & PRODUCTO
PRINT“LA COMISION DEL VENDEDORES:” & COMISION
PRINT“EL IMPORTE VENDIDOES:” & IMPORTE_VENDIDO
END
PUBLIC SUB MAIN ()
DIM E AS INTEGER
….
SELEC CASE E
CASE 0 TO 2
PRINT”BEBE”
CASE 2 TO 12
PRINT“NIÑO”
CASE 18
PRINT”BINGOYA PUEDES VOTAR”
CASE 13 TO 17
PRINT“JOVEN”
CASE ELSE
PRINT“ADULTO”
END SELECT
PUBLIC SUB MAIN ()
DIM ESTACIONESASSTRING
CASE 1
PRINT“VERANO”
CASE 2
PRINT“OTOÑO”
CASE 3
PRINT“INVIERNO”
CASE 4
PRINT“PRIMAVERA”
END SELECT
PUBLIC SUB MAIN ()
DIM MAS INTEGER
DIM D ASINTEGER
SELECT CASEMONTO
CASE 0 TO I50
DESCUENTO= 10
CASE 151 TO 300
DESCUENTO= 20
CASE 301 TO 450
DESCUENTO= 30
PRINT“NO HAY DESCUENTO”
END SELECT
PRINT”EL DESCUENTO DE LA PROXIMA COMPRA ES DE:” & DESCUENTO & “%”
END
PUBLIC SUB MAIN ()
DIM A AS INTEGER
DIM B AS INTEGER
DIM C ASINTEGER
PRINT“INGRESE EL VALORDE: A”
INPUT B
PRINT“INGRESE EL VALORDE: B”
INPUT B
PRINTC
IF A > B AND A > C THEN
PRINT“EL MAYOR ES:” & A
ELSE
IF B > A AND B > C THEN
PRINT“EL MAYOR ES:” & B
ELSE
PRINT“EL MAYOR ES:” & C
ENDIF
PUBLIC SUB MAIN ()
DIM FPAS INTEGER
DIM V AS FLOAT
DIM D ASFLOAT
PRINT“LA FORMA DE PAGOES:”
INPUT FP
PRINT”EL VALORES:”
INPUT V
IF FP= 1 THEN
D= (V * 10) / 100
PRINT“EL DESCUENTO ES:” & D
ELSE
IF FP= 2 THEN
D= (V*15) /100
PRINT“EL DESCUENTO ES:” & D
ELSE
PRINT“NO HAY DESCUENTO”
ENDIF
END

More Related Content

Viewers also liked

the mechanistic basis for the observed effects of CP in GC
the mechanistic basis for the observed effects of CP in GCthe mechanistic basis for the observed effects of CP in GC
the mechanistic basis for the observed effects of CP in GC
Samieh Asadian
 
Need for Systems Analysis & Design-19Jul2016
Need for Systems Analysis & Design-19Jul2016Need for Systems Analysis & Design-19Jul2016
Need for Systems Analysis & Design-19Jul2016
Conrad Sebego
 
Plenary_Mod-1Rec_AAG-ver'03
Plenary_Mod-1Rec_AAG-ver'03Plenary_Mod-1Rec_AAG-ver'03
Plenary_Mod-1Rec_AAG-ver'03
Conrad Sebego
 
WPC Implementation structure for Vithale Electrical
WPC Implementation structure for Vithale ElectricalWPC Implementation structure for Vithale Electrical
WPC Implementation structure for Vithale Electrical
Conrad Sebego
 

Viewers also liked (10)

Scaling Engineering with Docker
Scaling Engineering with DockerScaling Engineering with Docker
Scaling Engineering with Docker
 
the mechanistic basis for the observed effects of CP in GC
the mechanistic basis for the observed effects of CP in GCthe mechanistic basis for the observed effects of CP in GC
the mechanistic basis for the observed effects of CP in GC
 
Need for Systems Analysis & Design-19Jul2016
Need for Systems Analysis & Design-19Jul2016Need for Systems Analysis & Design-19Jul2016
Need for Systems Analysis & Design-19Jul2016
 
правова освіта для батьків
правова освіта для батьківправова освіта для батьків
правова освіта для батьків
 
школа розвитку успішної особистості
школа розвитку успішної особистостішкола розвитку успішної особистості
школа розвитку успішної особистості
 
Plenary_Mod-1Rec_AAG-ver'03
Plenary_Mod-1Rec_AAG-ver'03Plenary_Mod-1Rec_AAG-ver'03
Plenary_Mod-1Rec_AAG-ver'03
 
Shan
ShanShan
Shan
 
New insight in gastric cancer
New insight in gastric cancerNew insight in gastric cancer
New insight in gastric cancer
 
WPC Implementation structure for Vithale Electrical
WPC Implementation structure for Vithale ElectricalWPC Implementation structure for Vithale Electrical
WPC Implementation structure for Vithale Electrical
 
Birth-supporting women on the journey of birth.
Birth-supporting women on the journey of birth.Birth-supporting women on the journey of birth.
Birth-supporting women on the journey of birth.
 

Similar to ejercicio en Gambas (16)

Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Manual De Gambas
Manual De GambasManual De Gambas
Manual De Gambas
 
Proyecto Blob
Proyecto BlobProyecto Blob
Proyecto Blob
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Gambas
GambasGambas
Gambas
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
Trabajo Para Subir
Trabajo Para SubirTrabajo Para Subir
Trabajo Para Subir
 
Gambas
Gambas Gambas
Gambas
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 
Codigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De GambasCodigo Fuente De Ejercicios De Gambas
Codigo Fuente De Ejercicios De Gambas
 
Programacion
ProgramacionProgramacion
Programacion
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

ejercicio en Gambas

  • 1. PUBLIC SUB MAIN () DIM NOMBRE ASSTRING DIM CANTON ASSTRING DIM PROVINCIA ASSTRING DIM PAISASSTRING NOMBRE= “HUGO B. CRUZ ANDRADE” CANTON=“EL CARMEN” PROVINCIA=“ECUADOR” PRINTNOMBRE & “,” & CANTON “,” & PROVINCIA END PUBLIC SUB MAIN () DIM A AS BYTE DIM B ASBYTE DIM S ASBYTE A= S B= 4 S= 9 PRINTS END PUBLIC SUB MAIN () DIM EDAD ASINTEGER …. IF EDAD > 20 THEN PRINT“ADULTO” ENDFIN
  • 2. PUBLIC SUB MAIN () DIM A AS BYTE DIM B ASBYTE DIM S ASBYTE DIM R ASBYTE DIM MAS BYTE DIM D ASBYTE A=”7” B= “3” S= A+B PRINT“EL RESULTADO DE LA SUMA ES:” S R= A-B PRINT“EL RESULTADO DE LA RESTA ES:” R M= A *B PRINT“EL RESULTADO DE LA MULTIPLICACION ES:” M S= A/B PRINT“EL RESULTADO DE LA DIVISION ES:”D END PUBLIC SUB MAIN () DIM NOMBRE ASSTRING DIM APELLIDOSASSTRING NOMBRE= “MANUEL” APELLIDOS=“ALVARESGOMEZ” PRINTAPELLIDOS& “,” & NOMBRE END
  • 3. PUBLIC SUB MAIN () DIM MAS INTEGER DIM C ASINTEGER DIM C1 AS INTEGER DIM TOTAL ASINTEGER DIM P1 ASFLOAT DIM P2 ASFLOAT DIM P3 ASFLOAT M= 300 C= 400 C1= 800 TOTAL= M+C+C1 P1= (M/TOTAL) * 100 P2= (C/TOTAL) * 100 P3= (C1/TOTAL) * 100 PRINT”EL TOTAL DE EXPORTACION:”&TOTAL PRINT“EL PORCENTAJEDE MAIZ:” & P1 & “%” PRINT“EL PORCENTAJEDE CAFÉ:” &P2 & “%” PRINT“EL PORCENTAJEDE CACAO:”& P3 & “%” END
  • 4. PUBLIC SUB MAIN () DIM TOTAL ASFLOAT DIM PAS STRING DIM PRECIOASFLOAT DIM IVA ASFLOAT PRINT”INGRESEUN PRODUCTO” INPUT PRODUCTO PRINT“INGRESE EL PRECIO” INPUT PRECIO IVA=PRECIO* 12% TOTAL= PRECIO * IVA PRINT“EL IVA DEL PRODUCTO ES:” & IVA PRINT “EL PRECIO CON EL IVA ES:” & TOTAL END PUBLIC SUB MAIN () DIM CANTIDAD AS SINGLE DIM PRECIO AS SINGLE DIM PRODUCTO STRING DIM SUBTOTAL SIGLE DIM PRECIO_TOTAL SINGLE DIM DESCUENTO AS SINGLE PRINT “INGRESE LA CANTIDAD” INPUT CANTIDAD PRINT “INGRESE EL PRECIO DEL PRODUCTO” INPUT PRECIO SUBTOTAL= CANTIDAD * PRECIO DESCUENTO= SUBTOTAL * 0.05 PRECIO_TOTAL= SUBTOTAL- DESCUENTO PRINT “EL PRODUCTO INGRESADO ES:” & PRODUCTO PRINT”EL DESCUENTO ES:” & DESCUENTO PRINT “EL TOTAL A PAGAR ES:” &PRECIO_TOTAL END
  • 5. PUBLIC SUB MAIN () DIM PRECIOASSINGLE DIM CANTIDADASINTEGER DIM PRODUCTOAS STRING DIM IMPORTE ASSINGLE DIM COMISION ASSINGLE DIM IMPORTE_VENDIDOASSINGLE PRINT“INGRESE LA CANTIDAD” INPUT CANTIDAD PRINT“INGRESE EL PRECIO” INPUT PRECIO IMPORTE= CANTIDAD* PRECIO COMISION=IMPORTO * 0.05 IMPORTE_VENDIDO=IMPORTE + COMISION PRINT“EL PRODUCTO INGRESADOES:” & PRODUCTO PRINT“LA COMISION DEL VENDEDORES:” & COMISION PRINT“EL IMPORTE VENDIDOES:” & IMPORTE_VENDIDO END
  • 6. PUBLIC SUB MAIN () DIM E AS INTEGER …. SELEC CASE E CASE 0 TO 2 PRINT”BEBE” CASE 2 TO 12 PRINT“NIÑO” CASE 18 PRINT”BINGOYA PUEDES VOTAR” CASE 13 TO 17 PRINT“JOVEN” CASE ELSE PRINT“ADULTO” END SELECT PUBLIC SUB MAIN () DIM ESTACIONESASSTRING CASE 1 PRINT“VERANO” CASE 2 PRINT“OTOÑO” CASE 3 PRINT“INVIERNO” CASE 4 PRINT“PRIMAVERA” END SELECT
  • 7. PUBLIC SUB MAIN () DIM MAS INTEGER DIM D ASINTEGER SELECT CASEMONTO CASE 0 TO I50 DESCUENTO= 10 CASE 151 TO 300 DESCUENTO= 20 CASE 301 TO 450 DESCUENTO= 30 PRINT“NO HAY DESCUENTO” END SELECT PRINT”EL DESCUENTO DE LA PROXIMA COMPRA ES DE:” & DESCUENTO & “%” END PUBLIC SUB MAIN () DIM A AS INTEGER DIM B AS INTEGER DIM C ASINTEGER PRINT“INGRESE EL VALORDE: A” INPUT B PRINT“INGRESE EL VALORDE: B” INPUT B PRINTC IF A > B AND A > C THEN PRINT“EL MAYOR ES:” & A ELSE IF B > A AND B > C THEN PRINT“EL MAYOR ES:” & B ELSE PRINT“EL MAYOR ES:” & C ENDIF
  • 8. PUBLIC SUB MAIN () DIM FPAS INTEGER DIM V AS FLOAT DIM D ASFLOAT PRINT“LA FORMA DE PAGOES:” INPUT FP PRINT”EL VALORES:” INPUT V IF FP= 1 THEN D= (V * 10) / 100 PRINT“EL DESCUENTO ES:” & D ELSE IF FP= 2 THEN D= (V*15) /100 PRINT“EL DESCUENTO ES:” & D ELSE PRINT“NO HAY DESCUENTO” ENDIF END