SlideShare una empresa de Scribd logo
1 de 6
Universidad de Oriente
Escuela de Ingeniería de Sistemas
Núcleo Monagas
Introducción a la Lógica Formal y Algorítmica
Ejercicios de Algoritmos
Bachilleres:
Ynet
Maturín, 22 septiembre de 2010.
Contenido
1. Realizar un algoritmo cualitativo que indique los pasos a seguir para cambiar una
caucho de un vehículo tomando en cuenta que el vehículo está detenido y se
conoce cual caucho hay que cambiar.
2. Sobre las piedras hay tres ranas amarillas y tres ranas rojas en medio de los dos
grupos de ranas hay una piedra vacía, se debe lograr que intercambien sus
posiciones: las amarillas donde están las rojas y viceversa. Deben tener en cuenta
lo siguiente que sólo hay dos movimientos posibles, siempre para adelante:
i. mover una rana a la piedra vecina, que debe estar vacía,
ii. o hacer saltar una rana por encima de otra y caer en la piedra vacía.
Realizar un algoritmo. Puede ver un ejemplo en
http://www.albinoblacksheep.com/flash/frog .
3. Un palíndromo es una palabra o numero que se lee igual tanto de derecha a
izquierda o de izquierda a derecha, realice un algoritmo que dada una palabra
determine si es palindrome.
4. Una empresa necesita conocer el sueldo neto a pagar 50 empleado. Teniendo como
entrada el salario, produzca una salida de sueldo neto. Los descuentos a aplicar
son: ivss 5%, caja de ahorros 10%, lph 5%, estos descuentos son sobre el salario y
es sueldo neto, la diferencia entre el salario y el total de las retenciones.
Desarrollo
1) Algoritmo Cualitativo – Cambio de un Caucho a un Carro.
1) Inicio.
2) Tienes el Gato, la llave de cruz y el caucho de repuesto?
2.1) Si, entonces continuar.
2.2) No, entonces FIN.
3) Abrir el baúl.
4) Sacar gato, llave de cruz, y caucho de repuesto.
5) Ubicar llanta derecha delantera.
6) Levantar el carro usando el gato.
7) Aflojar tornillos del caucho usando llave de cruz.
8) Sacar los tornillos del caucho.
9) Quitar el caucho.
10) Colocar caucho de repuesto.
11) Colocar tornillos.
12) Apretar tornillos usando la llave de cruz.
13) Bajar el gato.
14) Guardar en el baúl, el gato, la llave y el caucho remplazado.
15) Cerrar el baúl.
16) Fin.
2) Algoritmo – Solución al Enigma de las ranas.
1) Inicio.
2) Variables SapoA, SapoR
3) Condición de movimientos - “SapoA” //Sapos Amarillos
2.1) Mover solo hacia la derecha
SI hay una piedra vecina vacía O salta a un sapo y cae en piedra vacía
ENTONCES.
Mover.
ELSE (DE LO CONTRARIO)
Reiniciar.
FIN SI
4) Condición de movimientos - “SapoR” //Sapos Rojos
3.1) Mover Solo hacia la izquierda
Si hay una piedra vecina vacía O salta un sapo y cae en piedra vacía
ENTONCES.
Mover.
ELSE (DE LO CONTRARIO)
Reiniciar
FIN SI
5) Numerar cantidad de sapos amarillos izquierda a derecha -
sapoA1,sapoA2,sapoA3.
6) Numerar cantidad de sapos rojos izquierda a derecha– sapoR1,sapoR2,sapoR3.
7) Contar piedras alfabéticamente de izquierda a derecha– A,B,C,D,E,F,G.
8) Posición inicial de “SapoA” - SapoA1-“A”, SapoA2-“B”, SapoA3-“C”
9) Posicion Inicial de “SapoR” – SapoR1-“E”, SapoR2-“F”, SapoR3-“G”
10) Mover “SapoA3” de “C” a “D”
11) Mover “SapoR1” de “E” a “C” saltando “SapoA3”
12) Mover “SapoR2” de “F” a “E” a piedra vacía.
13) Mover “SapoA3” de “D” a “F” saltando “SapoR2”
14) Mover “SapoA2” de “B” a “D” saltando “SapoR1”
15) Mover “SapoA1” de “A” a “B” a piedra vacía.
16) Mover “SapoR1” de “C” a “A” Saltando “SapoA1”
17) Mover “SapoR2” de “E” a “C” saltando “SapoA2”
18) Mover “SapoR3” de “G” a “E” saltando “SapoA3”
19) Mover “SapoA3” de “F” a “G”
20) Mover “SapoA2” de “D” a “F” saltando “SapoR3”
21) Mover “SapoA1” de “B” a “D” saltando “SapoR2”
22) Mover “SapoR2” de “C” a “B”
23) Mover “SapoR3” de “E” a “C” saltando “SapoA1”
24) Mover “SapoA1” de “D” a “E”
25) Mostrar posición final de “SapoA” – SapoA1-“E”,SapoA2-“F”,SapoA3-“G”
26) Mostrar posición final de “SapoR”- SapoR1-“A”, SapoR2-“B”, SapoR3-“C”
27) Fin
3) Algoritmo – Identificar palabras Palindrome
1) Inicio.
2) Leer (palabra)
3) n = longitud ( Palabra ) // Obtenemos el tamaño de la palabra.
4) pos = 1 // Posición para recorrer las posiciones en la palabra
5) PARA i = n hasta 1 hacer // Ciclo que recorre de forma inversa la palabra
NuevaPalabra [ i ] = Palabra [ pos ]
pos = pos + 1
FIN PARA // Este ciclo invierte la palabra se almacena en “NuevaPalabra”
6) Si (Palabra = NuevaPalabra)
Imprimir (Palabra, 'Es palindrome' )
Caso contrario
Imprimir (Palabra, ' NO es palindrome' )
FIN SI
7) FIN
4) Algoritmo – Cualcular Sueldo de 50 empleados y descuentos.
1) Inicio
2) Variables (sueldoneto, Salario, Totaldescuento, cincuentaemneto, cincuentaemsal);
3) imprimir (“Ingrese sueldo”);
4) Leer (Sueldoneto);
5) Totaldescuento ( sueldoneto * 20/100)
6) Salario  ( sueldoneto – totaldescuento);
7) Imprimir (“sueldo neto a 1 trabajado es “Sueldoneto” y aplicando descuentos de
IVSS, Caja de Ahorros y IPH, siendo un total de 20% su salario es “Salario””)
8) cincuentaemneto ( sueldoneto * 50)
9) Cincuentaemsal  ( salario * 50)
10)Imprimir (“Sueldo neto a 50 Trabajadores es “cincuentaemneto” y el Salario a 50
empleados es “cincuentaemsal”)
11)FIN
2) Variables (sueldoneto, Salario, Totaldescuento, cincuentaemneto, cincuentaemsal);
3) imprimir (“Ingrese sueldo”);
4) Leer (Sueldoneto);
5) Totaldescuento ( sueldoneto * 20/100)
6) Salario  ( sueldoneto – totaldescuento);
7) Imprimir (“sueldo neto a 1 trabajado es “Sueldoneto” y aplicando descuentos de
IVSS, Caja de Ahorros y IPH, siendo un total de 20% su salario es “Salario””)
8) cincuentaemneto ( sueldoneto * 50)
9) Cincuentaemsal  ( salario * 50)
10)Imprimir (“Sueldo neto a 50 Trabajadores es “cincuentaemneto” y el Salario a 50
empleados es “cincuentaemsal”)
11)FIN

Más contenido relacionado

Último

origen y desarrollo del ensayo literario
origen y desarrollo del ensayo literarioorigen y desarrollo del ensayo literario
origen y desarrollo del ensayo literarioELIASAURELIOCHAVEZCA1
 
Feliz Día de la Madre - 5 de Mayo, 2024.pdf
Feliz Día de la Madre - 5 de Mayo, 2024.pdfFeliz Día de la Madre - 5 de Mayo, 2024.pdf
Feliz Día de la Madre - 5 de Mayo, 2024.pdfMercedes Gonzalez
 
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñoproyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñotapirjackluis
 
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptxRigoTito
 
Prueba libre de Geografía para obtención título Bachillerato - 2024
Prueba libre de Geografía para obtención título Bachillerato - 2024Prueba libre de Geografía para obtención título Bachillerato - 2024
Prueba libre de Geografía para obtención título Bachillerato - 2024Juan Martín Martín
 
La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...JonathanCovena1
 
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLA
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLAACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLA
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLAJAVIER SOLIS NOYOLA
 
PIAR v 015. 2024 Plan Individual de ajustes razonables
PIAR v 015. 2024 Plan Individual de ajustes razonablesPIAR v 015. 2024 Plan Individual de ajustes razonables
PIAR v 015. 2024 Plan Individual de ajustes razonablesYanirisBarcelDelaHoz
 
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdfMiguelHuaman31
 
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdf
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdfNUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdf
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdfUPTAIDELTACHIRA
 
PLAN DE REFUERZO ESCOLAR primaria (1).docx
PLAN DE REFUERZO ESCOLAR primaria (1).docxPLAN DE REFUERZO ESCOLAR primaria (1).docx
PLAN DE REFUERZO ESCOLAR primaria (1).docxlupitavic
 
Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Lourdes Feria
 
LA LITERATURA DEL BARROCO 2023-2024pptx.pptx
LA LITERATURA DEL BARROCO 2023-2024pptx.pptxLA LITERATURA DEL BARROCO 2023-2024pptx.pptx
LA LITERATURA DEL BARROCO 2023-2024pptx.pptxlclcarmen
 
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VS
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VSOCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VS
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VSYadi Campos
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAEl Fortí
 

Último (20)

origen y desarrollo del ensayo literario
origen y desarrollo del ensayo literarioorigen y desarrollo del ensayo literario
origen y desarrollo del ensayo literario
 
Unidad 3 | Metodología de la Investigación
Unidad 3 | Metodología de la InvestigaciónUnidad 3 | Metodología de la Investigación
Unidad 3 | Metodología de la Investigación
 
Feliz Día de la Madre - 5 de Mayo, 2024.pdf
Feliz Día de la Madre - 5 de Mayo, 2024.pdfFeliz Día de la Madre - 5 de Mayo, 2024.pdf
Feliz Día de la Madre - 5 de Mayo, 2024.pdf
 
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niñoproyecto de mayo inicial 5 añitos aprender es bueno para tu niño
proyecto de mayo inicial 5 añitos aprender es bueno para tu niño
 
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx
2 REGLAMENTO RM 0912-2024 DE MODALIDADES DE GRADUACIÓN_.pptx
 
Supuestos_prácticos_funciones.docx
Supuestos_prácticos_funciones.docxSupuestos_prácticos_funciones.docx
Supuestos_prácticos_funciones.docx
 
Prueba libre de Geografía para obtención título Bachillerato - 2024
Prueba libre de Geografía para obtención título Bachillerato - 2024Prueba libre de Geografía para obtención título Bachillerato - 2024
Prueba libre de Geografía para obtención título Bachillerato - 2024
 
Presentacion Metodología de Enseñanza Multigrado
Presentacion Metodología de Enseñanza MultigradoPresentacion Metodología de Enseñanza Multigrado
Presentacion Metodología de Enseñanza Multigrado
 
La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...La empresa sostenible: Principales Características, Barreras para su Avance y...
La empresa sostenible: Principales Características, Barreras para su Avance y...
 
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLA
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLAACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLA
ACERTIJO DE POSICIÓN DE CORREDORES EN LA OLIMPIADA. Por JAVIER SOLIS NOYOLA
 
PIAR v 015. 2024 Plan Individual de ajustes razonables
PIAR v 015. 2024 Plan Individual de ajustes razonablesPIAR v 015. 2024 Plan Individual de ajustes razonables
PIAR v 015. 2024 Plan Individual de ajustes razonables
 
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf
2024 KIT DE HABILIDADES SOCIOEMOCIONALES.pdf
 
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdf
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdfNUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdf
NUEVAS DIAPOSITIVAS POSGRADO Gestion Publica.pdf
 
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdfTema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
Tema 8.- PROTECCION DE LOS SISTEMAS DE INFORMACIÓN.pdf
 
PLAN DE REFUERZO ESCOLAR primaria (1).docx
PLAN DE REFUERZO ESCOLAR primaria (1).docxPLAN DE REFUERZO ESCOLAR primaria (1).docx
PLAN DE REFUERZO ESCOLAR primaria (1).docx
 
Medición del Movimiento Online 2024.pptx
Medición del Movimiento Online 2024.pptxMedición del Movimiento Online 2024.pptx
Medición del Movimiento Online 2024.pptx
 
Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...Caja de herramientas de inteligencia artificial para la academia y la investi...
Caja de herramientas de inteligencia artificial para la academia y la investi...
 
LA LITERATURA DEL BARROCO 2023-2024pptx.pptx
LA LITERATURA DEL BARROCO 2023-2024pptx.pptxLA LITERATURA DEL BARROCO 2023-2024pptx.pptx
LA LITERATURA DEL BARROCO 2023-2024pptx.pptx
 
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VS
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VSOCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VS
OCTAVO SEGUNDO PERIODO. EMPRENDIEMIENTO VS
 
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURAFORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
FORTI-MAYO 2024.pdf.CIENCIA,EDUCACION,CULTURA
 

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Logica trabajo

  • 1. Universidad de Oriente Escuela de Ingeniería de Sistemas Núcleo Monagas Introducción a la Lógica Formal y Algorítmica Ejercicios de Algoritmos Bachilleres: Ynet Maturín, 22 septiembre de 2010.
  • 2. Contenido 1. Realizar un algoritmo cualitativo que indique los pasos a seguir para cambiar una caucho de un vehículo tomando en cuenta que el vehículo está detenido y se conoce cual caucho hay que cambiar. 2. Sobre las piedras hay tres ranas amarillas y tres ranas rojas en medio de los dos grupos de ranas hay una piedra vacía, se debe lograr que intercambien sus posiciones: las amarillas donde están las rojas y viceversa. Deben tener en cuenta lo siguiente que sólo hay dos movimientos posibles, siempre para adelante: i. mover una rana a la piedra vecina, que debe estar vacía, ii. o hacer saltar una rana por encima de otra y caer en la piedra vacía. Realizar un algoritmo. Puede ver un ejemplo en http://www.albinoblacksheep.com/flash/frog . 3. Un palíndromo es una palabra o numero que se lee igual tanto de derecha a izquierda o de izquierda a derecha, realice un algoritmo que dada una palabra determine si es palindrome. 4. Una empresa necesita conocer el sueldo neto a pagar 50 empleado. Teniendo como entrada el salario, produzca una salida de sueldo neto. Los descuentos a aplicar son: ivss 5%, caja de ahorros 10%, lph 5%, estos descuentos son sobre el salario y es sueldo neto, la diferencia entre el salario y el total de las retenciones.
  • 3. Desarrollo 1) Algoritmo Cualitativo – Cambio de un Caucho a un Carro. 1) Inicio. 2) Tienes el Gato, la llave de cruz y el caucho de repuesto? 2.1) Si, entonces continuar. 2.2) No, entonces FIN. 3) Abrir el baúl. 4) Sacar gato, llave de cruz, y caucho de repuesto. 5) Ubicar llanta derecha delantera. 6) Levantar el carro usando el gato. 7) Aflojar tornillos del caucho usando llave de cruz. 8) Sacar los tornillos del caucho. 9) Quitar el caucho. 10) Colocar caucho de repuesto. 11) Colocar tornillos. 12) Apretar tornillos usando la llave de cruz. 13) Bajar el gato. 14) Guardar en el baúl, el gato, la llave y el caucho remplazado. 15) Cerrar el baúl. 16) Fin. 2) Algoritmo – Solución al Enigma de las ranas. 1) Inicio. 2) Variables SapoA, SapoR 3) Condición de movimientos - “SapoA” //Sapos Amarillos 2.1) Mover solo hacia la derecha SI hay una piedra vecina vacía O salta a un sapo y cae en piedra vacía ENTONCES. Mover. ELSE (DE LO CONTRARIO) Reiniciar. FIN SI 4) Condición de movimientos - “SapoR” //Sapos Rojos 3.1) Mover Solo hacia la izquierda Si hay una piedra vecina vacía O salta un sapo y cae en piedra vacía ENTONCES. Mover. ELSE (DE LO CONTRARIO) Reiniciar FIN SI
  • 4. 5) Numerar cantidad de sapos amarillos izquierda a derecha - sapoA1,sapoA2,sapoA3. 6) Numerar cantidad de sapos rojos izquierda a derecha– sapoR1,sapoR2,sapoR3. 7) Contar piedras alfabéticamente de izquierda a derecha– A,B,C,D,E,F,G. 8) Posición inicial de “SapoA” - SapoA1-“A”, SapoA2-“B”, SapoA3-“C” 9) Posicion Inicial de “SapoR” – SapoR1-“E”, SapoR2-“F”, SapoR3-“G” 10) Mover “SapoA3” de “C” a “D” 11) Mover “SapoR1” de “E” a “C” saltando “SapoA3” 12) Mover “SapoR2” de “F” a “E” a piedra vacía. 13) Mover “SapoA3” de “D” a “F” saltando “SapoR2” 14) Mover “SapoA2” de “B” a “D” saltando “SapoR1” 15) Mover “SapoA1” de “A” a “B” a piedra vacía. 16) Mover “SapoR1” de “C” a “A” Saltando “SapoA1” 17) Mover “SapoR2” de “E” a “C” saltando “SapoA2” 18) Mover “SapoR3” de “G” a “E” saltando “SapoA3” 19) Mover “SapoA3” de “F” a “G” 20) Mover “SapoA2” de “D” a “F” saltando “SapoR3” 21) Mover “SapoA1” de “B” a “D” saltando “SapoR2” 22) Mover “SapoR2” de “C” a “B” 23) Mover “SapoR3” de “E” a “C” saltando “SapoA1” 24) Mover “SapoA1” de “D” a “E” 25) Mostrar posición final de “SapoA” – SapoA1-“E”,SapoA2-“F”,SapoA3-“G” 26) Mostrar posición final de “SapoR”- SapoR1-“A”, SapoR2-“B”, SapoR3-“C” 27) Fin 3) Algoritmo – Identificar palabras Palindrome 1) Inicio. 2) Leer (palabra) 3) n = longitud ( Palabra ) // Obtenemos el tamaño de la palabra. 4) pos = 1 // Posición para recorrer las posiciones en la palabra 5) PARA i = n hasta 1 hacer // Ciclo que recorre de forma inversa la palabra NuevaPalabra [ i ] = Palabra [ pos ] pos = pos + 1 FIN PARA // Este ciclo invierte la palabra se almacena en “NuevaPalabra” 6) Si (Palabra = NuevaPalabra) Imprimir (Palabra, 'Es palindrome' ) Caso contrario Imprimir (Palabra, ' NO es palindrome' ) FIN SI 7) FIN 4) Algoritmo – Cualcular Sueldo de 50 empleados y descuentos. 1) Inicio
  • 5. 2) Variables (sueldoneto, Salario, Totaldescuento, cincuentaemneto, cincuentaemsal); 3) imprimir (“Ingrese sueldo”); 4) Leer (Sueldoneto); 5) Totaldescuento ( sueldoneto * 20/100) 6) Salario  ( sueldoneto – totaldescuento); 7) Imprimir (“sueldo neto a 1 trabajado es “Sueldoneto” y aplicando descuentos de IVSS, Caja de Ahorros y IPH, siendo un total de 20% su salario es “Salario””) 8) cincuentaemneto ( sueldoneto * 50) 9) Cincuentaemsal  ( salario * 50) 10)Imprimir (“Sueldo neto a 50 Trabajadores es “cincuentaemneto” y el Salario a 50 empleados es “cincuentaemsal”) 11)FIN
  • 6. 2) Variables (sueldoneto, Salario, Totaldescuento, cincuentaemneto, cincuentaemsal); 3) imprimir (“Ingrese sueldo”); 4) Leer (Sueldoneto); 5) Totaldescuento ( sueldoneto * 20/100) 6) Salario  ( sueldoneto – totaldescuento); 7) Imprimir (“sueldo neto a 1 trabajado es “Sueldoneto” y aplicando descuentos de IVSS, Caja de Ahorros y IPH, siendo un total de 20% su salario es “Salario””) 8) cincuentaemneto ( sueldoneto * 50) 9) Cincuentaemsal  ( salario * 50) 10)Imprimir (“Sueldo neto a 50 Trabajadores es “cincuentaemneto” y el Salario a 50 empleados es “cincuentaemsal”) 11)FIN