Introducción a la programación

Páginas: 3 (742 palabras) Publicado: 21 de enero de 2012
package org.ip.eInteractiva;

import java.io.*;

public class EntradaInteractiva {

public static int leerEntero() throws IOException {
BufferedReader teclado = new BufferedReader(newInputStreamReader(System.in));
String cadena = teclado.readLine();
int valor = Integer.parseInt(cadena);
return valor;
}
public static double leerReal() throws IOException {
BufferedReaderteclado = new BufferedReader(new InputStreamReader(System.in));
String cadena = teclado.readLine();
double valor = Double.parseDouble(cadena);
return valor;
}
public static charleerCaracter() throws IOException {
BufferedReader teclado = new BufferedReader(new InputStreamReader(System.in));
String cadena = teclado.readLine();
char valor = cadena.charAt(0);
return valor;}
public static String leerCadena() throws IOException {
BufferedReader teclado = new BufferedReader(new InputStreamReader(System.in));
String cadena = teclado.readLine();
return cadena;}

}

+º+º+º+º+º+º+º+º+º+

package org.ip.eInteractiva;

import java.util.Scanner;

public class EntradaInteractivaScanner {

public static int leerEntero(String mensaje){System.out.print(mensaje);
return new Scanner(System.in).nextInt();
}
public static double leerReal(String mensaje){
System.out.print(mensaje);
return new Scanner(System.in).nextDouble();}
public static String leerCadena(String mensaje){
System.out.print(mensaje);
return new Scanner(System.in).nextLine();
}
}

+º+º+º+º+º+º+º+º+º+

package org.ip.sesion02;

importjava.io.*;

public class HolaMundo {

public static void main(String[] args) throws IOException {
System.out.println("Hola Mundo");

}

}

+º+º+º+º+º+º+º+º+º+

packageorg.ip.sesion02;

import java.io.*;

public class OperadorUnario {

public static void main(String[] args) throws IOException {
int i,a,b,c;
System.out.println("\t\tAntes\tDurante\tDespues");
//...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Introducción A La Programacion
  • introducción a la programacion
  • Introduccion A La Programacion
  • Introducción A La Programación O. O.
  • Introduccion a la programacion
  • Introduccion a programacion
  • INTRODUCCION A LA PROGRAMACION
  • programacion introduccion

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS