Skip to content

Commit 510be50

Browse files
Merge branch 'main' of github.com:mouredev/roadmap-retos-programacion; branch 'JesusAEE' of github.com:JesusAntonioEEscamilla/roadmap-retos-programacion into JesusAEE
2 parents 0661240 + 672a29a commit 510be50

File tree

32 files changed

+4486
-862
lines changed

32 files changed

+4486
-862
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* EJERCICIO:
3+
* - Crea un comentario en el código y coloca la URL del sitio web oficial del
4+
* lenguaje de programación que has seleccionado.
5+
* - Representa las diferentes sintaxis que existen de crear comentarios
6+
* en el lenguaje (en una línea, varias...).
7+
* - Crea una variable (y una constante si el lenguaje lo soporta).
8+
* - Crea variables representando todos los tipos de datos primitivos
9+
* del lenguaje (cadenas de texto, enteros, booleanos...).
10+
* - Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!"
11+
*
12+
* ¿Fácil? No te preocupes, recuerda que esta es una ruta de estudio y
13+
* debemos comenzar por el principio.
14+
*/
15+
16+
// Ejercicio #00.1
17+
// https://dotnet.microsoft.com/es-es/languages/csharp
18+
19+
// Ejercicio #00.2: Comentario en una línea
20+
/*
21+
Comentario
22+
múltiples
23+
líneas
24+
*/
25+
int x = /*comentario en linea de codigo*/ 1;
26+
27+
// Ejercicio #00.3
28+
int y = 0; // Declaracion de variable (tipo int)
29+
const double pi = 3.14159265; //Declaracion de constante (tipo double)
30+
31+
// Ejercicio #00.4
32+
//********Tipos enteros************
33+
sbyte sb = 0; //Variable tipo sbyte (8 bits con signo)
34+
byte b = 0; //Variable tipo byte (8 bits sin signo)
35+
short s = 0; //Variable tipo short (16 bits con signo)
36+
ushort us = 0; //Variable tipo ushort (16 bits sin signo)
37+
int i = 0; //Variable tipo int (32 bits con signo)
38+
uint ui = 0; //Variable tipo uint (32 bits sin signo)
39+
long L = 0; //Variable tipo long (64 bits con signo)
40+
ulong uL = 0; //Variable tipo ulong (64 bits sin signo)
41+
//********Tipos punto flotante************
42+
float f = 0.0f; //Variable tipo float (decimales)(4 bytes)(presicion 6 a 9 digitos aprox.)
43+
double d = 0.0; //Variable tipo double (decimales)(8 bytes)(presicion 15 a 17 digitos aprox.)
44+
decimal m = 0.0m; //Variable tipo decimal (decimales)(16 bytes)(presicion 28 a 29 digitos aprox.)
45+
//********Tipo bool************
46+
bool b1 = true; //Representacion true en bool
47+
bool b2 = false; //Representacion false en bool
48+
//********Tipo caracteres************
49+
char c = 'a'; //Variable tipo char (16 bits)
50+
string cadena = "Variable para cadena de texto"; //Variable tipo string (coleccion secuencial solo lectura objetos char)
51+
//*******Asignacion implicita********
52+
var z = 1; //Asigna como int
53+
var w = 'b'; //Asigna como char
54+
var p = "Hola"; //Asigna como string
55+
56+
// Ejercicio #00.5:
57+
Console.WriteLine("Hola C#");
58+
59+
60+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package main
2+
3+
import "fmt"
4+
5+
//Documentacipn en http://go.dev/
6+
7+
//Comentario en una linea
8+
/*
9+
Comentario
10+
en
11+
varias
12+
lineas
13+
*/
14+
15+
const Pi float64 = 3.1416
16+
var language string = "Golang"
17+
18+
func main(){
19+
var age int = 39
20+
var name string = "Aldo"
21+
var isDev bool = true
22+
var nota float64 = 9.3
23+
fmt.Println("Hello, " + language)
24+
fmt.Printf("Hola soy %v, tengo %v años, mi nota mas alta es %v, %v!",age, name, nota, isDev)
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// #00 - Sintaxis, variables, tipos de datos y hola mundo
2+
3+
// www.java.com
4+
5+
public class Qv1ko {
6+
7+
public static void main (String[] args) {
8+
9+
// Comment
10+
11+
/*
12+
* Comment
13+
*/
14+
15+
int var1 = 1;
16+
final int VAR2 = 2;
17+
18+
String str1 = "Java";
19+
int var3 = 3;
20+
float var4 = 4.4f;
21+
double var5 = 5.5;
22+
boolean bool = true;
23+
24+
System.out.println("¡Hola, " + str1 + "!");
25+
26+
}
27+
28+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
# #00 - Sintaxis, variables, tipos de datos y hola mundo
4+
5+
# www.php.net
6+
7+
main();
8+
9+
function main() {
10+
11+
/* comment */
12+
13+
// comment
14+
15+
# comment
16+
17+
$var1 = 1;
18+
19+
define("VAR2", 2);
20+
21+
$str = 'PHP';
22+
$var3 = 3;
23+
$var4 = 4.4;
24+
$bool = true;
25+
26+
echo "¡Hola, " . $str . "!";
27+
28+
}
29+
30+
?>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#Existen diversas maneras de poner comentarios en Python como los siguientes:
2+
3+
#https://www.python.org/
4+
5+
"""
6+
Esto tambien es
7+
un comentario
8+
de varias lineas de texto
9+
"""
10+
11+
'''Tambien se pueden usar comidas simples
12+
y no pasa nada, no afecta al código'''
13+
14+
my_variable = 'Mi variable'
15+
my_variable = 'Nuevo valor de mi variable'
16+
17+
"""Python no tiene constantes"""
18+
19+
MY_CONSTANT = 'Mi constante' #Por convención se utilizan las constantes en mayusculas y las variables con formato snake_case
20+
MY_CONSTANT = 'LE PUEDO CAMBIAR EL VALOR POR QUE NO HAY CONSTANTES'
21+
22+
#Python tiene 4 tipo de datos primitivos
23+
#De esta manera se ve puede especificar que a esa variable solo se le pone el tipo de datos que le antepones en la etiqueta
24+
my_int: int = 1
25+
my_float: float = 2.3
26+
my_boolean: bool = True
27+
my_bool: bool = False
28+
my_string: str = 'hola mundo'
29+
30+
print(my_string)
31+
32+
33+
print(type(my_int))
34+
print(type(my_float))
35+
print(type(my_boolean))
36+
print(type(my_string))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#https://wiki.python.org
2+
3+
#Comentario 1
4+
5+
"""
6+
7+
Comentario 2
8+
9+
"""
10+
11+
'''
12+
13+
Comentario 3
14+
15+
'''
16+
17+
Variable_1 = "Esto es una Variable"
18+
Constante_1 = "Esto es una Constante"
19+
20+
21+
# Crea variables representando todos los tipos de datos primitivos del lenguaje (cadenas de texto, enteros, booleanos...)
22+
23+
String = "Hola Mundo"
24+
Integers = 12
25+
Float = 12.5
26+
Boolean_1 = False
27+
Boolean_2 = True
28+
Non = None
29+
30+
#Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!"
31+
32+
print("Hello, Python!")
33+
34+
print(type(String))
35+
print(type(Integers))
36+
print(type(Float))
37+
print(type(Boolean_1))
38+
print(type(Boolean_2))
39+
print(type(Non))
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# URL Python
2+
# https://python.org
3+
4+
5+
# Representa diferentes sintaxis que existen de crear comentarios en Python
6+
7+
# Comentario en una línea
8+
9+
"""
10+
Comentario en varias
11+
líneas con comillas
12+
dobles.
13+
"""
14+
15+
'''
16+
Comentario en varias
17+
líneas con comillas
18+
simples.
19+
'''
20+
21+
# Crear variable y constante
22+
mi_variable = "¡Hola!"
23+
mi_constante = "¿Cómov vas?"
24+
25+
# Tipos de datos
26+
numero_int = 4
27+
numero_float = 2.0
28+
booleano_true = True
29+
booleano_false = False
30+
mi_string = "Soy un string"
31+
32+
print("¡Hola, Python!")
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main(){
6+
// Operadores aritmeticos
7+
fmt.Printf("La suma de 2 + 3 es: %d \n", 2+3)
8+
fmt.Printf("La suma de 2 - 3 es: %d \n", 2-3)
9+
fmt.Printf("La suma de 2 * 3 es: %d \n", 2*3)
10+
fmt.Printf("La suma de 6 / 3 es: %d \n", 2/3)
11+
fmt.Printf("La suma de 6 %% 3 es: %d \n", 2%3)
12+
13+
// Operaciones relacionales
14+
fmt.Printf("5 == 4\n", 5==4)
15+
fmt.Printf("5 != 4\n", 5!=4)
16+
fmt.Printf("5 < 4\n", 5<4)
17+
fmt.Printf("5 <= 4\n", 5<=4)
18+
fmt.Printf("5 > 4\n", 5>4)
19+
fmt.Printf("5 >= 4\n", 5>=4)
20+
21+
// Operadores logicos
22+
fmt.Printf("(5 > 4) && (5 == 3) es: %t \n", (5 > 3) && (5 == 3))
23+
fmt.Printf("(5 >= 4) || (5 < 3) es: %t \n", (5 >= 3) || (5 < 3))
24+
fmt.Printf("!(5 != 4) es: %t \n", !(5 != 3))
25+
26+
// Operadores bit a bit
27+
var x int = 8
28+
var y int = 4
29+
30+
fmt.Printf("El resultado de 8 & 4 es: %d \n", x&y)
31+
fmt.Printf("El resultado de 8 | 4 es: %d \n", x|y)
32+
fmt.Printf("El resultado de 8 ^ 4 es: %d \n", x^y)
33+
fmt.Printf("El resultado de 8 << 2 es: %d \n", x<<2)
34+
fmt.Printf("El resultado de 8 >> 2 es: %d \n", x>>2)
35+
36+
// Estructuras de Control
37+
38+
// Ejemplo de if.. else
39+
40+
if 5 > 3 {
41+
fmt.Println("5 es mayor que 3")
42+
} else {
43+
fmt.Println("5 no es mayor que 3")
44+
}
45+
46+
// Ejemplo de switch
47+
48+
switch 5 {
49+
case 1:
50+
fmt.Println("El numero es 1")
51+
case 2:
52+
fmt.Println("El numero es 2")
53+
case 3:
54+
fmt.Println("El numero es 3")
55+
case 4:
56+
fmt.Println("El numero es 4")
57+
case 5:
58+
fmt.Println("El numero es 5")
59+
default:
60+
fmt.Println("El numero es mayor que 5")
61+
}
62+
63+
// Ejemplo de for
64+
65+
for i := 0; i < 5; i++ {
66+
fmt.Println(i)
67+
}
68+
69+
// Ejemplo de for con range
70+
71+
my_array := []int{1, 2, 3, 4, 5}
72+
73+
for index, value := range my_array {
74+
fmt.Printf("El valor en la posicion %d es %d \n", index, value)
75+
}
76+
77+
// while
78+
79+
j := 0
80+
for j < 5 {
81+
fmt.Println(j)
82+
j++
83+
}
84+
85+
// do while
86+
87+
k := 0
88+
for {
89+
fmt.Println(k)
90+
k++
91+
if k == 5 {
92+
break
93+
}
94+
}
95+
96+
// Extra
97+
98+
for i := 10; i <= 55; i++ {
99+
if i%2 == 0 && i != 16 && i%3 != 0 {
100+
fmt.Println(i)
101+
}
102+
}
103+
104+
}

0 commit comments

Comments
 (0)