UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

Problema Resuelto 01




Resultado de imagen para suma

package problema.nº2;
import java.io.*;
/**
 *
 * @author ABEL MONTALVAN
 */
public class ProblemaNº2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
       
        int n1,n2,s;
       
       BufferedReader in =new BufferedReader(new  InputStreamReader(System.in));
       System.out.println("numero 1:");
       n1  = Integer.parseInt(in.readLine());
       System.out.println("numero 2:");
       n2  = Integer.parseInt(in.readLine());
     
       s=n1+n2;
     
       System.out.println("");
       System.out.println("suma: " +s);
         
     
    }
}

Problema Propuesto 18


18.- DADO 02 NÚMEROS ENTEROS A Y B, DETERMINAR CUÁL ES MAYOR CON RESPECTO AL OTRO.

Resultado de imagen para A MAYOR QUE B

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto018;
import java.util.Scanner;
/**
 *
 * @author abel montalvan
 */
public class PROPUESTO018 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    int a,b;
            String X = "";

            Scanner teclado=new Scanner(System.in);
            System.out.print("1er Número(A):");
            a=teclado.nextInt();
            System.out.print("2do Número(B):");
            b=teclado.nextInt();
            
            if(a>b){
                  X = "A es mayor que B";
            }else{
                  if(b>a){
                     X = "B es Mayor que A";
                  }
            }
            if(a==b){
                  X = "A es igual a B";
                  }
            
            System.out.println("");
            System.out.println("EL RESULTADO ES: " +X);
      }
}

Problema Propuesto 17



17.- DADO UN SALDO ANTERIOR. TIPO DE MOVIMIENTO R(RETIRO) O D(DEPOSITO) Y MONTO DE LA TRANSACCION, OBTENER COMO DATO DE SALIDA EL SALDO ACTUAL.


Resultado de imagen para SALDO

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto017;
import java.util.Scanner;
/**
 *
 * @author abel montalvan
 */
public class PROPUESTO017 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    int sal_ant, monto, sal_actual=0;
    char tipo_mov;
    
    
            Scanner teclado = new Scanner(System.in);
            System.out.print("Ingresar el Saldo: ");
            sal_ant=teclado.nextInt();
            System.out.print("Ingresar el Tipo de Movimiento: ");
            tipo_mov = teclado.next().charAt(0);
            System.out.print("Ingresar el Monto: ");
            monto=teclado.nextInt();
            
            if(tipo_mov=='R'){
                  sal_actual = sal_ant - monto;
            }
            else
            {
                  if(tipo_mov=='D'){
                   sal_actual = sal_ant + monto;
                  }
            }
            
            System.out.println("");
            System.out.print("El saldo actual es: "+sal_actual);
            System.out.println();       
    }
      }

Problema Propuesto 16



16.- PROMEDIO DE LAS 03 MEJORES NOTAS (APROBADO O DESAPROBADO)

Resultado de imagen para APROBADO

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto016;
import java.util.Scanner;
/**
 *
 * @author abel montalvan
 */
public class Propuesto016 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
       int a,b,c,d,Pr=0;
            String X;
                 
          Scanner teclado=new Scanner(System.in);
         
          System.out.print("NOTA 1:");
          a=teclado.nextInt();
          System.out.print("NOTA 2:");
          b=teclado.nextInt();
          System.out.print("NOTA 3:");
          c=teclado.nextInt();
          System.out.print("NOTA 4:");
          d=teclado.nextInt();
            
            if(a<b &&a<c && a<d){
                  Pr=(b+c+d)/3;
            }else{
                  if (b<a&&b<c && b<d){
                       Pr=(a+c+d)/3;
                  }else{
                       if (c<a&&c<b && c<d){
                             Pr=(a+b+d)/3;
                       }else{
                             Pr=(a+b+c)/3;
                       }
                  }
            }
            if(Pr>=11){
                  X="APROBADO";
            }else{
                  X="DESAPROBADO";
            }
           
            System.out.println("");
            System.out.println("PROMEDIO: "+Pr);
            System.out.println("CONDICIÓN: "+X);
      }
}

Problema Propuesto 15


15.- Dado 03 números, devolver los números ordenados en forma ascendente y descendente.



/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto015;
import java.util.Scanner;
/**
 *
 * @author abel montalvan
 */
public class Propuesto015 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
     int a,b,c,Ma=0,I=0,Me=0;
                       
            Scanner teclado=new Scanner(System.in);
            System.out.print("PRIMER NÚMERO:");
            a=teclado.nextInt();
            System.out.print("SEGUNDO NÚMERO:");
            b=teclado.nextInt();
            System.out.print("TERCER NÚMERO:");
            c=teclado.nextInt();
           
           
            if (a>b && a>c){
                  Ma=a;
            }else{
            if (b>a && b>c){
                  Ma=b;
            }else{
                  Ma=c;
            }
            }
            if(a<b &&a<c){
                  Me=a;
            }else{
            if (b<a&&b<c){
                  Me=b;
            }else{
                  Me=c;
                  }
            }
            I=(a+b+c)-(Ma + Me);
          
            
            System.out.println("");
            System.out.println("ORDEN DESCENDENTE: ");
            System.out.println("MAYOR: "+Ma);
            System.out.println("INTERMEDIO: "+I);
            System.out.println("MENOR: "+Me);
            System.out.println("ORDEN ASCENDENTE: ");
            System.out.println("MENOR: "+Me);
            System.out.println("INTERMEDIO: "+I);
            System.out.println("MAYOR: "+Ma);
      }
}

Problema Propuesto 14



14.- DADO UN NUMERO ENTERO DEVOLVER EL DOBLE DEL NUMERO SI EL NUMERO ES POSITIVO, EL TRIPLE SI ES NEGATIVO Y CERO SI ES NEUTRO.


Resultado de imagen para POSITIVO

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto014;
import java.util.Scanner;
/**
 *
 * @author abel montalvan
 */
public class Propuesto014 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        int a,b;
           

            Scanner teclado=new Scanner(System.in);
            System.out.print("ESCRIBIR UN NÚMERO:");
            a=teclado.nextInt();
           
            //PROCESO
            if (a>0){
                  b=a*2;
            }else{
            if (a<0){
                  b=a*3;
            }else{
                  b=0;
            }
            }
            System.out.println("");
            System.out.println("EL RESULTADO ES: "+b);
            }
      }

Problema Propuesto 13



13.- DADO DOS NÚMEROS DETERMINAR SI SON IGUALES O DIFERENTES

Resultado de imagen para IGUALES O DIFERENTES

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto013;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Propuesto013 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException{
     int a,b;
      BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Número 1: ");
 a= Integer.parseInt(in.readLine());
 System.out.println("Número 2: ");
 b=Integer.parseInt(in.readLine());

     
       if(a==b)
       
     System.out.println("números son iguales");    

       else

     System.out.println("números son diferentes");
       
   
    }
}

Problema Propuesto 12



12.- DEVOLVER EL NUMERO MENOR


Resultado de imagen para NUMERO MENOR

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto012;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Propuesto012 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
    int n1,n2,m;
 BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Número 1: ");
 n1= Integer.parseInt(in.readLine());
 System.out.println("Número 2: ");
 n2=Integer.parseInt(in.readLine());

 if (n1>n2)
 {

     m=n2;
     }
     else
     {
     m=n1;
     }

 System.out.println("");
 System.out.println("Menor: "+m);

    }
}        
       

Problema Propuesto 11


11.- MAYOR O MENOR DE EDAD

Resultado de imagen para MAYOR DE EDAD

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package propuesto011;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Propuesto011 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int edad;
        BufferedReader in =new BufferedReader(new  InputStreamReader(System.in));
      System.out.println("ingresa la edad de cualquier persona");
      edad  = Integer.parseInt(in.readLine());
      
           
       if(edad>=18)
     System.out.println("la persona es mayor de edad");    

       else

           System.out.println("la persona es menor de edad");
       
   
    }
}

Problema Propuesto 10



10.-GRADOS SEXAGESIMALES A CENTESIMALES

Resultado de imagen para grados sexagesimales a centesimales


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package problema20;
import java.io.*;
/**
 *
 * @author abel montalvan
 */
public class Problema20 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        double s,c;
     
BufferedReader in =new BufferedReader(new  InputStreamReader(System.in));
 System.out.println("Grados Sexagesimales: ");
    s=Integer.parseInt(in.readLine());
    c=s*200/180;
    
           
 System.out.println("");
 System.out.println("A grados Centesimales: "+c);



    }
}