TOPIC

O que está errado?

Marlon Mazzine dos Santos asked 3 years ago

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);

    double A = scan.nextDouble();
    double B = scan.nextDouble();
    double C = scan.nextDouble();

    double MEDIA = ((A * 2) + (B * 3) + (C * 5)) / 10;

    System.out.printf("MEDIA = %.1f", MEDIA);

    scan.close();
}

}

Remember not post solutions. Your post may be reviewed by our moderators.

  • Danielli Vargas replied 1 year ago

    import java.io.IOException; import java.util.Scanner; public class Main {

    public static void main(String[] args) throws IOException {
    
        Scanner x = new Scanner(System.in);   
    
     double A = x.nextDouble();
     double B = x.nextDouble();
      double C = x.nextDouble();
     double soma = (A*2+B*3+C*5);
     double MEDIA = soma/10 ;
       System.out.println(String.format("MEDIA = %.1f",MEDIA)); 
    
    }

    }