Introducción a JAVA COMP 250.

Slides:



Advertisements
Presentaciones similares
FUNDAMENTALS OF THE JAVA PROGRAMMING LANGUAGE (SL-110) CAPÍTULO 5: DECLARACIÓN, INICIALIZACIÓN Y USO DE VARIABLES Ing. Ronald Criollo.
Advertisements

FUNDAMENTALS OF THE JAVA PROGRAMMING LANGUAGE (SL-110) CAPÍTULO 7: OPERADORES Y ESTRUCTURAS DE SELECCION Ing. Ronald Criollo.
Introducción a JAVA COMP 250. Estructura de Selección selection statements selection statements – Escoger cuál acción ejecutar dependiendo de dos ó más.
Conceptos Básicos Prof. Carlos Rodríguez Sánchez
COMP 234 Prof. Carlos Rodríguez Sánchez
GETTING AROUND TOWN! Estar y Las Direcciones.. El Verbo Estar Use the verb estar to tell the location direction of people and things. For singular places,
Seminario de Lenguajes A – Opción Ada Seminario de Lenguajes A – Opción Ada – Raúl Champredonde1 Overloading de subprogramas procedure Put(Item: in integer;
Articles, nouns and contractions oh my!. The POWER of the article THE 1. There are four ways to express THE in Spanish 2. The four ways are: El La Los.
To make a sentence negative, you usually put no in front of the verb. Example: No pienso ir al cine. Sometimes you can also use a negative word after.
If anidados y Switch Prof. Lillian Bras.
JavaScript Programación Web. Java Script es un lenguaje de escripts que se usa en páginas web (ligero) Java es un lenguaje de programación orientada a.
Sección 5-2 Estructuras de Control de Decisión Expresiones Lógicas.
Numeric Types, Expressions, and Output
Telling Time.
Objective Distinguish the rules to form the plural of a noun.
4.1 Continuidad en un punto 4.2 Tipos de discontinuidades 4.3 Continuidad en intervalos.
COMP 250.  Ejemplo:  Suponer que se necesita codificar un programa donde se muestre como resultado el string “Bienvenidos al mundo de JAVA!!!” cien.
1 SOLVING RATIONAL EQUATIONS SIMPLIFYING RATIONAL EXPRESSIONS Standards 4, 7, 15, 25 ADDING RATIONAL EXPRESSIONS PROBLEM 1 RATIONAL EXPRESSIONS PROBLEM.
Símbolos de Programación Estructurada
Estructura de Selección en JAVA
Código (salario) #include int main() { int hours; double gross_pay,rate; cout rate; if (hours > 40) gross_pay = rate*40.
Lógica de Programación COIS 115 Profesor: Gustavo Velez.
Preposiciones dicen: Donde Each slide will change after a few seconds. For each slide you must decide where the BLACK box is. There are two possible answers.
Asking and Answering Questions!. Questions in Spanish always begin with an inverted question mark (¿). 1.
Avancemos 1 – Unidad 2 Lección 1
Forming Questions ¡Aprenda! Forming Questions By Patricia Carl October 2013.
1 Clase 6: control (1ª parte) iic1102 – introducción a la programación.
2012-BM5A. Unos tips antes de empezar: C# es Case Sensitive (sensible a mayúsculas) Pepe ≠ pepe ≠ pEpE Las asignaciones se hacen con “=” y las comparaciones.
Actividad 3 For each picture, you will hear two descriptions.Write the letter of the description that best matches the picture. 1.Roberto 2. Magda 3. Geraldo.
Estructuras de control Por Diego Caro A. udec.cl}
TELLING TIME IN SPANISH. What time is it? To ask what time it is, say “¿Qué hora es?”
Copy and state if the phrase is a CARACTERISTICA or CONDICION. 1.Es guapo. 2.Es sincera. 3.Está triste. 4.Está nervioso. 5.Es tímido. 6.Son inteligentes.
Control, adquisición y monitoreo con Arduino y Visual Basic .net
Los Adjetivos Possessivos
Taller de Java Universidad de los Andes
Tema 6: Elementos de programación adicionales
Operadores Java es un lenguaje rico en operadores, que son casi idénticos a los de C/C++.
Conceptos Básicos Prof. Carlos Rodríguez Sánchez
¿Cómo almacenar datos dentro del computador?
Diferentes maneras de manejar datos en JAVA
Olimpiadas Chilenas de Informática - Formación
Estructuras de control condicional y ciclos
8 de febrero de 2017.
8 de febrero de 2017.
TELLING TIME IN SPANISH
GUSTAR- LIKES AND DISLIKES
PREGUNTAS: Questions and Question Words
Bucles y estructuras de decisión
Teclado y Pantalla (Java estándar)
Apuntes: Los Adjetivos
Los números.
Unidad 3. Introducción a la programación
Programación en Java..
Notes 4 – Noun/Adjective Agreement
Avancemos 1 – Unidad 2 Lección 1
Diego Hernández R Pascal Variables Diego Hernández R
PREGUNTAS: Questions and Question Words
Los números.
Quasimodo: Tienes que hacer parte D de la tarea..
Affirmative & Negative Words
Bucles y estructuras de decisión
PROGRAMACIÓN (2).
Los artículos y los adjetivos
JAVA: elementos básicos
Leyendo strings de la línea de comandos
Imperfecto o pretérito.
Repaso: Negative expressions; ninguno(a)
Tratamientos secuenciales I
Astronomy has really big numbers. Distance between Earth and Sun meters kilometers This is the closest star.
Affirmative & Negative Words
Transcripción de la presentación:

Introducción a JAVA COMP 250

Estructura de Selección selection statements Escoger cuál acción ejecutar dependiendo de dos ó más alternativas a evaluar Las condiciones son expresiones booleanas, esto es, el resultado de una comparación es un valor booelano (true / false)

Estructura de Selección Operadores de comparación operador nombre ejemplo resultado < Menor que Radius < 0 false <= Menor o igual a Radius <= 0 > Mayor que Radius > 0 true >= Mayor o igual a Radius >= 0 == Igual a Radius == 0 != No igual a Radius != 0 Observar que el radio de un círculo no puede ser cero ó negativo (menor que cero)

Estructura de Selección Ejemplo double radius = 1; System.out.println(radius > 0); El valor a mostrar en el output debe ser true

Estructura de Selección if statements One-way if statements Formato: if (boolean-expression) { statement(s); } false (radius >= 0) true area = radius * radius * PI; System.out.println(“The area for the circle of radius “ + radius + “ is “ + area);

Estructura de Selección Two-way if statement Formato: if(boolean-expression) { statement(s)-for-the-true-case; } else { statement(s)-for-the-false-case; true false Boolean expression Statements for the true case Statements for the false case

Estructura de Selección Nested if statements if (score >= 90.0) grade = ‘A’; else if (score >= 80.0) grade = ‘B’; else if (score >=70.0) grade = ‘C’; else if (score >= 60.0) grade = ‘D’; else grade = ‘F’;

Estructura de Selección switch statement T Compute tax for single filers status = 0 break F T Status = 1 Compute tax for married filers break default Default actions

Estructura de Selección Ejemplo: switch (status) { case 0: compute taxes for single filers; break; case 1: compute taxes for married filers; default: System.out.println(“Errors: invalid status”); System.exit(0);

Formatting console output Formato general: System.out.printf(format, item1, item2, …itemz) Donde format es un string que puede consistir de varios formatos especializados

Formatting console output specifier output example %b A boolean value True or false %c A character ‘a’ %d A decimal integer 200 %f A floating-point number 45.460000 %e A number in standard scientific notation 4.556000e+01 %s A string “Java is cool” Ejemplo: int count =5; double amount = 45.56; System.out.printf(“count is %d and amount is %f”, count, amount); Output: count is 5 and amount is 45.560000

Formatting console output example output %5c Output the character and add four spaces before the character item %6b Output the boolean value and add one space before the false value and two spaces before the true value %5d Output the integer with width at least 5. %10.2f Output the floating-point number with width at least 10 including a decimal point and two digits after the point. %10.2e Output the floating-point item with width at least 10 including a decimal point , two digits after the point and the exponent part. %12s Output the string with width at least 12 characters

Logical Operators operator name description ! not Logical negation && and Logical conjunction || or Logical disjunction ^ Exclusive or Logical exclusion Ejemplos: (asumir que age = 24, gender = ‘F’) !(age > 18) …………………………………………………..false !(gender == ‘M’)…………………………………………..true