You are on page 1of 9

EJERCICIO 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 ejer13;
import java.util.Scanner;

/**
*
* @author jonny
*/
public class Ejer13 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner( System.in);
System.out.println("ingrese el numero de ventanas que helavoro");
int a,b,c,d,e;
a=entrada.nextInt();
b=1;
while (b<=a){
System.out.println(" ");

}
// TODO code application logic here
}

}
EJERCICO #2
/*
* 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 ejer.pkg2;
import java.util.Scanner;
/**
*
* @author jonny
*/
public class Ejer2 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner( System.in); // cuando trabajon por consola
System.out.println(" engrese el numero total de hambusrgesa a comprar");
int a,s,d,t,p,c;
a=entrada.nextInt();
System.out.println(" ingrese l numero de Hamburgesas que desea del tipo
s");
s=entrada.nextInt();
System.out.println(" ingrese el numero de hamnurgasa que desea del tipo
d");
d=entrada.nextInt();
System.out.println(" ingrese el numero de hamnurgasa que desea del tipo
t");
t=entrada.nextInt();
p=(s*20+d*25+t*28);
c=(int) (p*(0.05));
System.out.println(" el total a apagar es "+p);
System.out.println(" el total a apagar es "+c);

// TODO code application logic here


}

}
EJERCCIO #3
/*
* 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 ejer3;
import java.util.Scanner;
/**
*
* @author jonny
*/
public class Ejer3 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner( System.in);
System.out.println("este algoritmo te da la cantidad de numeros igual 0
,menor que 0y mayoe que 0 ");
System.out.println("ingrese la cantidad de numeros que ba a evaluar ");
int a,b,c,d,e,f;
a=entrada.nextInt();
b=1;
d=0;
e=0;
f=0;
while ( b<=a){
System.out.println("ingrese el valor "+b+" del los "+a+" numeros ");
c=entrada.nextInt();
if (c==0){
d=d+1;
}
else {
if (c<0){
e=e+1;
}
else{
if(0<c){
f=f+1;
}
else {
}
}
}

b=b+1;
}
System.out.println(" hay "+d+" numeros igual a 0");
System.out.println("hay "+e+" numeros menores a a 0");
System.out.println(" hay "+f+" numeros mayores a 0");

// TODO code application logic here


}

}
EJERCCIO #4
/*
* 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 ejer4;

import java.util.Scanner;

/**
*
* @author jonny
*/
public class Ejer4 {

/**
* @param args the command line arguments
*/

public static void main(String[] args) {


// TODO code application logic here
Scanner entrada=new Scanner ( System.in);
System.out.println(" numero tatal de focos ");
int p,n, m,s,a,v,b,r,c;
p=entrada.nextInt();
n=0;
m=0;
s=0;
a=1;
v=1;
b=2;
r=3;
while ( a<=p){
System.out.println(" ingrese el numero 1 si el foco es verde,"
+ "ingrese el numero 2 si el foco es blanco "+
" ingrese el numero 3 si el foco es rojo");
c=entrada.nextInt();
if ( c==1){
s=s+1;

}
else {
if(c==2 ){
n=n+1;
}
else {
if ( c==3){
m=m+1;
}
else{
}
}

}
a=a+1;
}
System.out.println(" los focos de color verde son "+s);
System.out.println(" los focos de color blanco son "+n);
System.out.println(" los focos de color rojo son "+m);

}
EJERCCIO #5
/*
* 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 ejer5;

/**
*
* @author jonny
*/
public class Ejer5 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int a,b,s;
s=0;
a=1;
b=1;
while (a<=365){
b=b*3;
System.out.println("el mes "+a+" aorra "+b);
s=s+b;
a=a+1;

}
System.out.println(" ahorro durante todo el ao "+s);
}

}
EJERCCIO #8

/*
* 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 ejer8;
import java.util.Scanner;

/**
*
* @author jonny
*/
public class Ejer8 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner(System.in);
System.out.println(" cuantos articulos a comprado");
int a,n,s,p,d;
n=entrada.nextInt();
a=1;
s=0;
while (a<=n){
System.out.println(" introduse el costo de tu articulo"+a);
p=entrada.nextInt();
if (200<=p){
p=(int) (p-0.15*p);
s=s+p;
d=(int) (0.15*p);
System.out.println(" el precio del articulo"+a+" es "+p);
}
else {
if ( (100<p) && (p<200)){
p=(int) (p-0.12*p);
d=(int) (0.12*p);
s=s+p;
System.out.println(" el precio del articulo"+a+" es "+p);
}
else {
p=(int) (p-0.1*p);
d=(int) (0.1*p);
s=s+p;
System.out.println(" el precio del articulo"+a+" es "+p);
}

}
a=a+1;

}
// TODO code application logic here
}

}
EJERCCIO #12
/*
* 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 ejer.pkg12;
import java.util.Scanner;

/**
*
* @author jonny
*/
public class Ejer12 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner( System.in);
System.out.println(" exscribe el umero total de monedas ");
int a,b,c,d,e,f,s,g,h;
c=1;
s=0;
h=1;
a=entrada.nextInt();
System.out.println(" ingrese el numero total de billetes ");
b=entrada.nextInt();
while ( c<=11)
System.out.println(" escriba 1 si va a ingresar el valor numerico de
cada de moneda "
+ " escriba 2 si va ingresar el valormnumerico de cada billete
");
d=entrada.nextInt();
if ( d==1){
while(h<=6 ){
System.out.println( "escriba 2 si ba ingresar el numero de monedas
de 0.1 centimos "+
" escriba 3 si va a ingresar el numero de monedas de 0.2
centimos "+
" escriba 4 si va a ingresar el numero de monedas de o.5
centimos "+
" escriba 5 si va a ingresar el numero de monedas de 1
sol"+
" escriba 6 si va a ingreasr el numero de monedas de 2
soles"+
" escriba 7 si va a ingresar el numero de monedas de 5
soles ");
e=entrada.nextInt();
if ( e==2){
g=entrada.nextInt();
s=(int) (s+g*0.1);
}
else {
if(e==3){
g=entrada.nextInt();
s=(int) (s+g*0.2);
}
else{
if (e==4){
g=entrada.nextInt();
s=(int) (s+g*0.5);
}
else {
if (e==5){
g=entrada.nextInt();
s=(int) (s+g*1);
}
else {
if(e==6){
g=entrada.nextInt();
s=(int) (s+g*2);

}
else {
if (e==7){
g=entrada.nextInt();
s=(int) (s+g*2);
}
else {}
}
}
}
}
}
h=h+1;
}

}
else {}
if (d==2){
while (h<=5){
System.out.println( "escriba 1 si ba ingresar el numero de
billetes de 10 soles "+
" escriba 2 si va a ingresar el numero de billetes de 20
soles "+
" escriba 3 si va a ingresar el numero de billestes de 50
soles "+
" escriba 4 si va a ingresar el numero de billetes de 100
soles"+
" escriba 5 si va a ingreasr el numero de billetes de 200
soles ");
f=entrada.nextInt();
if (f==1){
f=entrada.nextInt();
s=(int) (s+f*10);
}
else {
if (f==2){
f=entrada.nextInt();
s=(int) (s+f*20);
}
else {

if (f==3 ){
f=entrada.nextInt();
s=(int) (s+f*50);
}
else {
if ( f==4){
f=entrada.nextInt();
s=(int) (s+f*100);
}
else {
if(f==5){
f=entrada.nextInt();
s=(int) (s+f*100);
}
}
}
}

}
}
}
c=c+1;
}

// TODO code application logic here

EJERCCIO #13
/*
* 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 ejer13;
import java.util.Scanner;

/**
*
* @author jonny
*/
public class Ejer13 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner entrada=new Scanner( System.in);
System.out.println("ingrese el numero de ventanas que helavoro");
int a,b,c,d,e;
a=entrada.nextInt();
b=1;
while (b<=a){
System.out.println(" ");

}
// TODO code application logic here
}

You might also like