UNA HERMOSA MOTO

UNA HERMOSA MOTO

miércoles, 22 de abril de 2015

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);
      }
}

No hay comentarios:

Publicar un comentario