miércoles, 20 de agosto de 2014
Tarea N°2: “Programación orientada a objetos”
En esta exposición describiremos más a fondo en lo que consiste la programación orientada a objetos, su aplicación en el desarrollo de código y su interpretación.
Informe: https://docs.google.com/document/d/1miw1E1iPlUftnXXeFuUTzYKgMdivCz415j1mWIqs4H8/edit
Ppt: https://docs.google.com/presentation/d/1xwcsVUL-lzU-qGlhtWR9UvQI8XXptDtkm-UerJ9Jw_0/edit#slide=id.g379ae2212_3_75
miércoles, 6 de agosto de 2014
lunes, 4 de agosto de 2014
Tarea Clase U.
Tarea N° 1 : La clase "U", Imprime y Lee Datos por Consola.
package IO_basic;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import javax.swing.JOptionPane;
/**
*
* @author F.F.A
*/
//Se extiende de la clase IOException, para controlar excepciones de ingreso de datos.
class U extends IOException {
// Se crea un BufferedReader, para recibir datos por teclado.
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//Se establecen métodos para imprimir(cada uno con según tipo de variable recibida).
public void print(String s) {
System.out.print(s);
}
public void print(int s) {
System.out.print(s);
}
public void print(double s) {
System.out.print(s);
}
public void println(String s) {
System.out.println(s);
}
public void println(int s) {
System.out.println(s);
}
public void println(double s) {
System.out.println(s);
}
/* Se establecen métodos para la lectura de datos tipo Integer y Double; Se establece, en cada uno, un capturador de error en caso de mal ingreso, junto con pedir nuevamente el dato si este error surge.*/
public int readInt() {
int a = 0;
boolean rep = true;
while (rep) {
try {
a = Integer.parseInt(br.readLine());
rep=false;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ingrese un valor numérico válido", "Entrada invalidada", JOptionPane.ERROR_MESSAGE);
}
}
return a;
}
public int readInt(String s) {
int a = 0;
print(s);
a=readInt();
return a;
}
public double readDouble() {
double a = 0;
boolean rep = true;
while (rep) {
try {
a = Double.parseDouble(br.readLine());
rep=false;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ingrese un valor numérico válido", "Entrada invalidada", JOptionPane.ERROR_MESSAGE);
}
}
return a;
}
public double readDouble(String s) {
double a = 0;
print(s);
a=readDouble();
return a;
}
}
package IO_basic;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import javax.swing.JOptionPane;
/**
*
* @author F.F.A
*/
//Se extiende de la clase IOException, para controlar excepciones de ingreso de datos.
class U extends IOException {
// Se crea un BufferedReader, para recibir datos por teclado.
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//Se establecen métodos para imprimir(cada uno con según tipo de variable recibida).
public void print(String s) {
System.out.print(s);
}
public void print(int s) {
System.out.print(s);
}
public void print(double s) {
System.out.print(s);
}
public void println(String s) {
System.out.println(s);
}
public void println(int s) {
System.out.println(s);
}
public void println(double s) {
System.out.println(s);
}
/* Se establecen métodos para la lectura de datos tipo Integer y Double; Se establece, en cada uno, un capturador de error en caso de mal ingreso, junto con pedir nuevamente el dato si este error surge.*/
public int readInt() {
int a = 0;
boolean rep = true;
while (rep) {
try {
a = Integer.parseInt(br.readLine());
rep=false;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ingrese un valor numérico válido", "Entrada invalidada", JOptionPane.ERROR_MESSAGE);
}
}
return a;
}
public int readInt(String s) {
int a = 0;
print(s);
a=readInt();
return a;
}
public double readDouble() {
double a = 0;
boolean rep = true;
while (rep) {
try {
a = Double.parseDouble(br.readLine());
rep=false;
} catch (Exception e) {
JOptionPane.showMessageDialog(null, "Ingrese un valor numérico válido", "Entrada invalidada", JOptionPane.ERROR_MESSAGE);
}
}
return a;
}
public double readDouble(String s) {
double a = 0;
print(s);
a=readDouble();
return a;
}
}
Suscribirse a:
Entradas (Atom)
