# reto 8.doc - Nombre Jose Nombre del curso Matrcula 2764523...

• Test Prep
• 4
• 100% (1) 1 out of 1 people found this document helpful

This preview shows page 1 - 3 out of 4 pages.

Nombre : Jose Matrícula : 2764523 Nombre del curso: Programación orientada a objetos Nombre del profesor : Omar Módulo : 2 Actividad : Reto 8 Fecha : 23/03/18 Bibliografía : Excepciones 1. Programa package retos; import java.io.*; public class Retos { public static BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) throws IOException { int numero = 0 ; boolean corrector; do{ corrector = true; try{ System.out.print("Introduce un numero:"); numero= Integer.parseInt(entrada.readLine()); } catch (NumberFormatException e){ System.out.println("Error el dato que tecleaste, no es un numero. Intenta de nuevo"); corrector = false; } } while (corrector==false); System.out.println("Tu numero de la suerte es:"+numero); } } Resultado

Subscribe to view the full document.

2.- Programa package retos; import java.io.*; public class Retos { public static BufferedReader entrada = new BufferedReader(new InputStreamReader(System.in)); public static void main(String[] args) { int a,b; System.out.println("Teclea valores para a y b"); try{ System.out.print("a="); a= Integer.parseInt(entrada.readLine());
• Fall '17
• Column, Omar, Jose, un salto de línea

{[ snackBarMessage ]}

###### "Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern