Programa 1
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio.pkg1;
import java.util.Scanner;
/**
*
* @author conalep
*/
public class Ejercicio1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Paulina Guadalupe Rios Valdez");
System.out.println("Captura una variable de tipo entero: ");
int j=sc.nextInt();
System.out.println("Ciclo FOR ");
for(int x=1;x<=5;x++){
System.out.println(j);
}
System.out.println("Captura una variable de tipo short: ");
short i=sc.nextShort();
System.out.println("Ciclo FOR ");
for(int x=1;x<=7;x++){
System.out.println(i);
}
System.out.println("Captura una variable de tipo long: ");
long k=sc.nextLong();
System.out.println("Ciclo FOR ");
for(int x=1;x<=10;x++){
System.out.println(k);
}
System.out.println("Captura una variable de tipo byte: ");
byte h=sc.nextByte();
System.out.println("Ciclo FOR ");
for(int x=1;x<=6;x++){
System.out.println(h);
}
System.out.println("Captura una variable de tipo cadena: ");
String f=sc.next();
System.out.println("Ciclo FOR ");
for(int x=1;x<=6;x++){
System.out.println(f);
}
System.out.println("Captura una variable de tipo double: ");
double a=sc.nextDouble();
System.out.println("Ciclo FOR ");
for(int x=1;x<=12;x++){
System.out.println(a);
}
System.out.println("Captura una variable de tipo boolean: ");
boolean b=sc.nextBoolean();
System.out.println("Ciclo FOR ");
for(int x=1;x<=11;x++){
System.out.println(b);
}
// TODO code application logic here
}
}
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ejercicio.pkg1;
import java.util.Scanner;
/**
*
* @author conalep
*/
public class Ejercicio1 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Paulina Guadalupe Rios Valdez");
System.out.println("Captura una variable de tipo entero: ");
int j=sc.nextInt();
System.out.println("Ciclo FOR ");
for(int x=1;x<=5;x++){
System.out.println(j);
}
System.out.println("Captura una variable de tipo short: ");
short i=sc.nextShort();
System.out.println("Ciclo FOR ");
for(int x=1;x<=7;x++){
System.out.println(i);
}
System.out.println("Captura una variable de tipo long: ");
long k=sc.nextLong();
System.out.println("Ciclo FOR ");
for(int x=1;x<=10;x++){
System.out.println(k);
}
System.out.println("Captura una variable de tipo byte: ");
byte h=sc.nextByte();
System.out.println("Ciclo FOR ");
for(int x=1;x<=6;x++){
System.out.println(h);
}
System.out.println("Captura una variable de tipo cadena: ");
String f=sc.next();
System.out.println("Ciclo FOR ");
for(int x=1;x<=6;x++){
System.out.println(f);
}
System.out.println("Captura una variable de tipo double: ");
double a=sc.nextDouble();
System.out.println("Ciclo FOR ");
for(int x=1;x<=12;x++){
System.out.println(a);
}
System.out.println("Captura una variable de tipo boolean: ");
boolean b=sc.nextBoolean();
System.out.println("Ciclo FOR ");
for(int x=1;x<=11;x++){
System.out.println(b);
}
// TODO code application logic here
}
}
Comentarios
Publicar un comentario