FUNDAMENTOS DE PROGRAMACION DANIELA RODRIGUEZ L. HOJA DE RESUMEN FUNDAMENTOS DE PROGRAMACION DANIELA RODRIGUEZ L.
FUNCIONES BASICAS MATEMATICAS OPERACION EJEMPLO JAVA SUMA 5+2 RESTA 5-2 MULTIPLICACION 5x2 5*2 DIVISION 5 ÷2 5/2
FUNCIONES MATEMATICAS TRIGONOMETRICAS SIGNIFICADO EJEMPLO Math.sin(x) Calcular sen(x) Math.sin(Math.PI/3) MATH.SEN(50*Math.Pi/180) Math.cos(x) Calcular cos(x) Math.cos(Math.PI/4) Math.tan(x) Calcular tan(x) Math.tan(2*Math.PI/3) 1/Math.tan(x) Calcular cotan(x) 1/Math.cos(x) Calcular sec(x) 1/Math.cos(20*PI/180) 1/Math.sen(x) Calcular csec(x)
FUNCIONES LOGARÍTMICAS Y EXPONENCIALES SIGNIFICADO EJEMPLOS Math.log10(x) Calcular logaritmo en base 10 Log10(1000) = 3 Math.log10(1000) Math.log(x) Calcular logaritmo natural Ln(30) = 3,401197 E=2,7182818284 Math.log(30) Math.log(x)/Math.log(base) Calcular logaritmo en cualquier base Log3 81=4 -> Math.log(81)/Math.log(3) Log2 64= 6 -> Math.log(64)/Math.log(2) Math.exp.(x) 𝑒 𝑥 Calcular función exponencial 𝑒 5 =148,413159 Math.exp(5) 𝑥 𝑛 Calcular potencias 25 Math.pow(2,5)
RAICES CUADRADAS Y CUBICAS √𝑋= Math.sqrt(x) 3 𝑥 = Math.cbrt(x)
CREAR PROBLEMAS QUE TOMAN DESICIONES OPERADOR SIGNIFICADO EJEMPLO > MAYOR 5>3 >= MAYOR IGUAL < MENOR <= MENOR IGUAL != DIFRENTE DE
IF EN CASACADA if(condicion1){ realizar tarea 1 } else if(condicion2){ realizar tarea 2 else if(condicion3){ realizar tarea 3 else if(condicion4){ realizar tarea 4 else{
EJEMPLO CONTRASEÑA
EJEMPLO IMC
CREAR METODOS PARA REALIZAR TAREAS PUNTUALES tipo de retorno Nombre del metodo parametros public static double calcularDistancia(double x1, double x2, double y1, double y2){ double distancia =Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); return distancia; } retorno
CÓMO REPETIR UN CONJUNTO DE INSTRUCCIONES MULTIPLES VECES Instrucciones claves para repetir comandos Uso de ciclos for (cuando de antemano se sabe las veces en que se repite el código) Uso de los ciclos while (cuando es incierto cuando se finalizara el uso del código) Uso de la instrucción for each (
USO DE LOS CICLOS FOR For (inicializacion;condicion;incremento){ }
CICLO WHILE VS CICLO FOR For (inicializacion;condicion;incremento){ } inicialización While(condición){ Conjunto de instrucciones incremento
OPERACIONES PARA MANIPULAR MATRICES Definir y crear arreglos 2D Asignar un nombre, definir tamaño, definir el tipo de dato Almacenar datos en celdas especificadas Fila y columna especifica Ingresar datos por teclado y guardar en celdas Imprimir los datos del arreglo Consultar el menor/mayor valor
EJERCICIO PRACTICO CORTE 0 1 2 CORTE 1 CORTE 2 CORTE 3 0 1 2 j 0 1 2 CORTE 1 CORTE 2 CORTE 3 0 1 2 j ASIGNATURA 1 2 PENSAMIENTO MATEMATICO QUIMICA GENERAL FISICA 1 1 i 2 2,5 3,8 4,5 4,2 4,8 3,0 2,0
PROGRAMACION ORIENTADA A OBJETOS En el mundo real todos SON OBJETOS Los objetos se agrupan(clases): Por características comunes. Por funciones similares. Las características similares se llaman atributos Crear las relaciones Crear lo métodos Consultar-getters Actualizar-setters constructores
ELEFANTE Maculino Negro mamifero Comer Caminar
ELEFANTE jugador Nombre: james rodríguez Numero de goles: Equipo: Buscar nombre Actualizar numero de goles
SISTEMA DE INFORMACION ACADEMICO Programa académico codigo nombre director Facultad codigo nombre decano Pertenece a carrera Estudiante nombre primerApellido SegundoApellido email telefonoCelular Fecha día mes año Fecha de nacimiento Barrio nombre estrato zona Colegio nombre dirección teléfono Estudio en Ubicado en Vive en