1021
Aprender a programar desde cero / Re:QUIERO APRENDER PROGRAMACION DESDE CERO.
« en: 04 de Febrero 2014, 22:39 »
Aquí tienes por dónde empezar: https://www.aprenderaprogramar.com/foros/index.php?topic=733.0
Saludos
Saludos
Aprende Joomla con el libro "Creación y administración web con Joomla. Curso paso a paso" 2ª Edición. 168 pgs. Editorial aprenderaprogramar.com. Disponible en formato papel y ebook.
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
public class Test ()
línea 1
línea 2
etc.
etc.
etc.
line1
line2
for int i = 0; i<10; i++
etc.
etc.
- | 0 | 1 | 2 | 3 | 4 | 5 |
0 | 0 | 140 | 110 | 150 | 120 | 160 |
1 | - | 0 | 190 | 999 | 88 | 999 |
2 | - | - | 0 | 77 | 999 | 999 |
3 | - | - | - | 0 | 999 | 66 |
4 | - | - | - | - | 0 | 178 |
5 | - | - | - | - | - | 0 |
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
import java.io.*;
public class MenuEscribirLeer {
public static void main(String[] args) throws IOException{
String menu="MENU DE Escribir y Leer\n";
int n1,n2,n3;
int op=0;
menu+="1. Escribir\n";
menu+="2. Leer\n";
menu+="3. Fin\n";
menu+="Escoja Opción:\n";
while (op!=3){
op=Integer.parseInt(JOptionPane.showInputDialog(menu));
switch (op){
case 1:
ObjetoEscribir objeto1 = new ObjetoEscribir();
objeto1.crearCodigoEscribir();
break;
case 2:
ObjetoLeer objeto2 = new ObjetoLeer();
objeto2.crearCodigoLeer();
break;
case 3:
break;
}
}
} // cierre del public static void main Ojo !!!! //------------------
public static void escribir ()throws IOException{
// TODO code application logic here
String archivo="nombre.txt";
FileWriter fw= new FileWriter(archivo,true);
BufferedWriter bw= new BufferedWriter(fw);
PrintWriter pw= new PrintWriter (bw);
String nombre="";
int sueldo,edad;
nombre=JOptionPane.showInputDialog("digite nombre");
sueldo=Integer.parseInt(JOptionPane.showInputDialog("digite sueldo"));
edad=Integer.parseInt(JOptionPane.showInputDialog("digite edad"));
pw.println(nombre+"--__--"+sueldo+"--__--"+edad+"--__--");
JOptionPane.showMessageDialog(null,"los datos se guardaron EXCELENTE");
pw.close();
}
}
import javax.swing.*;
import java.io.*;
public class ObjetoEscribir {
public void crearCodigoEscribir() throws IOException {
// TODO code application logic here (algoritmo que escribe archivo)
String archivo="nombre.txt";
FileWriter fw= new FileWriter(archivo,true);
BufferedWriter bw= new BufferedWriter(fw);
PrintWriter pw= new PrintWriter (bw);
String nombre="";
int sueldo,edad;
nombre=JOptionPane.showInputDialog("digite nombre");
sueldo=Integer.parseInt(JOptionPane.showInputDialog("digite sueldo"));
edad=Integer.parseInt(JOptionPane.showInputDialog("digite edad"));
pw.println(nombre+"--__--"+sueldo+"--__--"+edad+"--__--");
JOptionPane.showMessageDialog(null,"los datos se guardaron EXCELENTE");
pw.close();
}
}
import javax.swing.*;
import java.io.*;
public class ObjetoLeer {
public void crearCodigoLeer() throws IOException {
// TODO code application logic here (algoritmo que lee archivo)
FileReader fr = new FileReader("nombre.txt");
BufferedReader br= new BufferedReader(fr);
String linea="";
linea=br.readLine();
while(linea!=null){
String vector[]= linea.split("--__--");
JOptionPane.showMessageDialog(null,"Nombre"+vector[0]+"\nsueldo1:"+vector[1]+"\nsueldo1:"+vector[2]);
linea=br.readLine();
}
}
}
Sobre la educación, sólo puedo decir que es el tema más importante en el que nosotros, como pueblo, debemos involucrarnos.
Abraham Lincoln (1808-1865) Presidente estadounidense.
aprenderaprogramar.com: Desde 2006 comprometidos con la didáctica y divulgación de la programación