This file contains hidden or 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
| ///Ejercicio 3 - Validaci贸n de Contrase帽a: | |
| /// Escribe una funci贸n que verifique si una | |
| /// contrase帽a es v谩lida. La contrase帽a | |
| /// debe tener al menos 8 caracteres y un n煤mero. | |
| void main() { | |
| final password = '2345'; | |
| if(validatePassword(password)) { | |
| print('Contrase帽a v谩lida'); |
This file contains hidden or 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
| ///Ejercicio 3 - Validaci贸n de Contrase帽a: | |
| /// Escribe una funci贸n que verifique si una | |
| /// contrase帽a es v谩lida. La contrase帽a | |
| /// debe tener al menos 8 caracteres y un n煤mero. | |
| void main() { | |
| final password = 'dsdsdsdsdsdsd'; | |
| if(validatePassword(password)) { | |
| print('Contrase帽a v谩lida'); |
This file contains hidden or 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
| /// Ejercicio 4: Eliminar Elementos | |
| /// Duplicados | |
| /// Escribe una funci贸n que elimine los | |
| /// elementos duplicados de una lista. | |
| void main() { | |
| final List<int> numeros = [2, 4, 6, 1, 2, 3, 5, 67, 23, 5, 2]; | |
| print(eliminarDuplicadosManualmente(numeros)); | |
| } |
This file contains hidden or 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
| /// Ejercicio 5: Clase de Estudiantes | |
| /// Crea una clase llamada Estudiante | |
| /// con propiedades como nombre, edad y calificaciones. | |
| /// Luego, crea una funci贸n que calcule el | |
| /// promedio de calificaciones de un grupo de estudiantes. | |
| class Estudiante { | |
| String nombre; | |
| int edad; | |
| int calificacion; |
This file contains hidden or 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
| ////Ejercicio 6: Gesti贸n de Inventario | |
| /// Crea una clase llamada Producto con | |
| /// propiedades como nombre, precio y cantidad | |
| /// en stock. Luego, crea funciones para agregar, | |
| /// eliminar y actualizar productos en un inventario. | |
| class Producto { | |
| int codigo; | |
| String nombre; | |
| double precio; |
This file contains hidden or 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
| /// Implementa una funci贸n que reciba | |
| /// una lista de n煤meros enteros y | |
| /// devuelva la suma de todos los elementos. | |
| // Imprime el resultado con interpolaci贸n de cadenas. | |
| void main() { | |
| final List<int> numeros = [23, 11, 3, 5, 12]; | |
| print('La suma de los n煤meros es: ${sumaLista(numeros)}'); | |
| } |
This file contains hidden or 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
| /// Escribe una funci贸n que tome una lista | |
| /// de n煤meros y devuelva el n煤mero m谩s | |
| /// grande de la lista. Utiliza un bucle | |
| /// for para encontrar el n煤mero m谩ximo en | |
| /// una lista. Imprime el resultado con | |
| /// interpolaci贸n de cadenas. | |
| void main() { | |
| final List<int> enteros = [2, 43, 65645, 1, 4, 76, 7]; |
This file contains hidden or 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
| /// POLIMORFISMO Y CLASES ABSTRACTAS | |
| abstract class Figura { | |
| String nombre; | |
| Figura({required this.nombre}); | |
| double area(); | |
| } |
This file contains hidden or 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
| /// Composici贸n: | |
| class Motor { | |
| void encender() { | |
| print('Runnn Runnn Runnn...'); | |
| } | |
| void apagar() { | |
| print('Trtrt...'); |
OlderNewer