miércoles, 22 de abril de 2015

propu_16


package propuesta.pkg16;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class PROPUESTA16 {

    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        int a,b,c,d,PROMEDIO=0;
            String M;
            BufferedReader in=new BufferedReader(new  InputStreamReader(System.in));
            System.out.print("Primera nota:");
             a=Integer.parseInt(in.readLine());//ojo
             System.out.print("Segunda nota:");
             b=Integer.parseInt(in.readLine());//ojo
             System.out.print("Tercera nota:");
             c=Integer.parseInt(in.readLine());//ojo
             System.out.print("Cuarta nota:");
             d=Integer.parseInt(in.readLine());//ojo
              if(a<b && a<c && a<d){
                  PROMEDIO=(b+c+d)/3;
            }else{
                  if (b<a && b<c && b<d){
                       PROMEDIO=(a+c+d)/3;
                  }else{
                       if (c<a && c<b && c<d){
                             PROMEDIO=(a+b+d)/3;
                       }else{
                             PROMEDIO=(a+b+c)/3;
                       }
                  }
            }
            if(PROMEDIO>=15){
                  M="Aprobado";
            }else{
                  M="Desaprobado";
                  }
             System.out.println("");
            System.out.println("Resultado:"+PROMEDIO);
            System.out.println("Mensaje:"+M);
           
    }
}

No hay comentarios:

Publicar un comentario