forked from mouredev/roadmap-retos-programacion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:mouredev/roadmap-retos-programacion…
… into JesusAEE
- Loading branch information
Showing
6 changed files
with
1,286 additions
and
853 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/java/jaimeNar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
public class jaimeNar { | ||
public static void main(String args[]) { | ||
// URL del sitio web oficial | ||
/** | ||
* https://www.java.com | ||
**/ | ||
|
||
// Diferentes sintáxis para crear comentarios | ||
// Comentario de una sola línea | ||
|
||
/* | ||
* Comentario de varias líneas | ||
*/ | ||
|
||
/** | ||
* Otro comentario de varias líneas | ||
**/ | ||
|
||
int variable; // Variable | ||
|
||
final int constant; // Constante | ||
|
||
// Variables que representan los tipos de datos primitivos | ||
byte by = 127; | ||
short num_sh = 32767; | ||
int num = 234567834; | ||
long num_long = 456546465L; | ||
float num_float = 1.5f; | ||
double num_double = 3.7; | ||
char character = 'A'; | ||
boolean bool = true; | ||
|
||
// Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!" | ||
System.out.println("¡Hola, Java!"); | ||
} | ||
} | ||
|
48 changes: 48 additions & 0 deletions
48
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/javascript/JoaquinLopez14.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* EJERCICIO: | ||
* 1 Crea un comentario en el código y coloca la URL del sitio web oficial del | ||
* lenguaje de programación que has seleccionado. | ||
* 2 Representa las diferentes sintaxis que existen de crear comentarios | ||
en el lenguaje (en una línea, varias...). | ||
* 3 Crea una variable (y una constante si el lenguaje lo soporta). | ||
* 4 Crea variables representando todos los tipos de datos primitivos | ||
del lenguaje (cadenas de texto, enteros, booleanos...). | ||
* 5 Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!" | ||
*/ | ||
|
||
|
||
// 1: https://developer.mozilla.org/es/docs/Web/JavaScript | ||
|
||
// 2: Existen 2 formas de crear comentarios en JavaScript: | ||
// Comentario de una sola línea | ||
// Esto es un comentario de una sola línea | ||
|
||
/* | ||
Comentario de múltiples líneas | ||
Esto es un comentario | ||
que abarca varias líneas | ||
*/ | ||
|
||
// 3 = | ||
let variable = 1; // variable | ||
const variable2 = 2; // constante | ||
|
||
// 4 = | ||
let string = "esto es un string"; | ||
let numEntero = 1; | ||
let numDecimal = 1.5; | ||
let booleanTrue = true; | ||
let booleanFalse = false; | ||
let nulo = null; | ||
|
||
let object = { | ||
nombre: "Joaquin", | ||
apellido: "Lopez" | ||
}; | ||
|
||
//5 = | ||
let helloWorld = "¡Hola, Javascript!"; | ||
console.log(helloWorld); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
|
||
|
||
|
||
|
||
##sets | ||
|
||
my_set = {"Alejandro", "Kevin", "Carmenza", 36} # no se puede ordenar y no se repiten | ||
my_set.add (24) | ||
my_set.add (24) | ||
print (my_set) | ||
my_set.remove ("Alejandro") | ||
print(my_set) | ||
|
||
#diccionarios | ||
|
||
diccionario = { | ||
"nombre": "alejandro", | ||
"edad":24, | ||
"apellido":"Mazo" | ||
} | ||
print (diccionario) | ||
|
||
diccionario["sexo"] = "Masculino" | ||
print (diccionario) | ||
del diccionario["edad"] | ||
print (diccionario) | ||
print(list(diccionario)) | ||
print (sorted(diccionario)) | ||
|
||
|
||
#Tuplas | ||
tuplas:tuple = ("hola", "Kevin", "Carmenza", 36) # pueden ser de distintos tipos, pero son inmutables | ||
print (tuplas[1]) | ||
|
||
#Listas | ||
|
||
lista = [1,2,3,4,5,6,6] #Es mutable, se pueden repetir elementos | ||
lista.append (5) | ||
print(lista) | ||
lista.sort() | ||
print(lista) | ||
lista.pop(2) | ||
print(lista) | ||
lista[2] = "Fabian" | ||
print(lista) | ||
|
||
|
||
##extra | ||
|
||
|
||
contactos = { | ||
"Nombre":[], | ||
"Apellido":[], | ||
"Numero":[] | ||
} | ||
def menu(): | ||
print("\n Contactos\n\n¿Que operacion desea realizar?\n\n ----Menu----") | ||
print("\n1. Agregar contacto.\n2. Buscar contacto\n3. Eliminar contacto.\n4. Actualizar contacto.\n5. Salir.\n ") | ||
|
||
def agregar(): | ||
print("Ingresa el nombre: ") | ||
nombre = str(input()) | ||
contactos["Nombre"].append(nombre) | ||
print("Ingresa el apellido: ") | ||
apellido = str(input()) | ||
contactos["Apellido"].append(apellido) | ||
while True: | ||
print("Ingresa el numero de telefono: ") | ||
try: | ||
numero = int(input()) | ||
numero_str = str(numero) | ||
count = len(numero_str) | ||
if count <= 11: | ||
contactos["Numero"].append(numero) | ||
print ("contacto agregado") | ||
break | ||
else: | ||
print ("Ingrese un numero de 11 digitos") | ||
except ValueError as e: | ||
print(f"Ingrese un numero correcto.... error {e}") | ||
|
||
|
||
def buscar(): | ||
nombre = str(input("Ingrese el nombre de contacto que desea buscar:\n")) | ||
apellido = str(input("ingrese el apellido del contato que desea buscar:\n")) | ||
|
||
for nombres, apellidos, numeros in zip(contactos["Nombre"],contactos["Apellido"],contactos["Numero"]): | ||
if nombre == nombres and apellido == apellidos: | ||
print (nombres,apellidos, numeros) | ||
|
||
|
||
def eliminar(): | ||
nombre = str(input("Ingrese el nombre del contacto que desea eliminar:\n")) | ||
apellido = str(input("ingrese el apellido del contato que desea eliminar:\n")) | ||
|
||
for nombres, apellidos, numeros in zip(contactos["Nombre"],contactos["Apellido"],contactos["Numero"]): | ||
if nombre == nombres and apellido == apellidos: | ||
contactos["Nombre"].remove(nombre) | ||
contactos["Apellido"].remove(apellido) | ||
contactos["Numero"].remove(numeros) | ||
|
||
|
||
print("Usuario eliminado") | ||
|
||
def actualizar(): | ||
nombre = str(input("Ingrese el nombre del contacto que desea actualizar:\n")) | ||
apellido = str(input("ingrese el apellido del contato que desea actualizar:\n")) | ||
|
||
for i in range(len(contactos["Nombre"])): | ||
if nombre == contactos["Nombre"][i] and apellido == contactos["Apellido"][i]: | ||
update_tel = int(input("Ingrese el numero nuevo: ")) | ||
contactos["Numero"][i] = update_tel | ||
print("Contacto actualizado") | ||
return | ||
|
||
|
||
|
||
def salir(): | ||
print("Saliendo...") | ||
|
||
|
||
|
||
while True: | ||
menu() | ||
opcion= int(input()) | ||
if opcion > 5 or opcion < 1: | ||
print("Seleccione una opcion del menu") | ||
else: | ||
if opcion == 1: | ||
agregar() | ||
elif opcion == 2: | ||
buscar() | ||
elif opcion == 3: | ||
eliminar() | ||
elif opcion == 4: | ||
actualizar() | ||
elif opcion == 5: | ||
salir() | ||
break | ||
else: | ||
print("Selecione una opcion correcta") | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
|
||
|
||
class Programador: | ||
|
||
def __init__(self, nombre:str, edad:int, lenguaje:list): | ||
self.nombre = nombre | ||
self.edad = edad | ||
self.lenguaje = lenguaje | ||
|
||
def impri(self): | ||
print(f"Nombre: {self.nombre} Edad: {self.edad} Lenguaje: {self.lenguaje}") | ||
|
||
|
||
|
||
|
||
|
||
my_programador = Programador("Andres", 22 , ["css","Python"]) | ||
my_programador.impri() | ||
my_programador.edad = 24 | ||
my_programador.impri() | ||
|
||
|
||
class Stack: | ||
def __init__(self): | ||
self.stack = [] | ||
|
||
def anadir(self,item): | ||
|
||
self.stack.append(item) | ||
print("Accion completada") | ||
|
||
def eliminar(self): | ||
|
||
self.stack.pop() | ||
|
||
print("Eliminacion completada") | ||
|
||
def cont(self): | ||
|
||
print(len(self.stack)) | ||
|
||
def imprimir(self): | ||
|
||
for item in reversed(self.stack): | ||
print(item) | ||
|
||
|
||
|
||
|
||
my_stack = Stack() | ||
my_stack.anadir("a") | ||
my_stack.anadir("b") | ||
my_stack.anadir("c") | ||
my_stack.imprimir() | ||
my_stack.cont() | ||
my_stack.eliminar() | ||
my_stack.imprimir() | ||
|
||
|
||
class Queue: | ||
def __init__(self): | ||
self.queue = [] | ||
|
||
def anadir(self,item): | ||
|
||
self.queue.append(item) | ||
print("Accion completada") | ||
|
||
def eliminar(self): | ||
|
||
self.queue.pop(0) | ||
|
||
print("Eliminacion completada") | ||
|
||
def cont(self): | ||
|
||
print(len(self.queue)) | ||
|
||
def imprimir(self): | ||
|
||
for item in (self.queue): | ||
print(item) | ||
|
||
|
||
|
||
|
||
my_queue = Queue() | ||
my_queue.anadir("a") | ||
my_queue.anadir("b") | ||
my_queue.anadir("c") | ||
my_queue.imprimir() | ||
my_queue.cont() | ||
my_queue.eliminar() | ||
my_queue.imprimir() |
Oops, something went wrong.