Picolo666 / ADO-

scripts dos programas propostos na ADO do prof bruno.
1 stars 0 forks source link

ADO 04 - 7 #29

Open Picolo666 opened 1 year ago

Picolo666 commented 1 year ago

import java.util.Scanner;

class Main {

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

System.out.println("Informe o valor do cateto oposto"); double oposto = ler.nextDouble();

System.out.println("Informe o valor do cateto adjacente"); double adjacente = ler.nextDouble();

double hhh = hipotenusa(oposto, adjacente);

System.out.println("A hipotenusa é " + hhh );
}

public static double hipotenusa (double oposto, double adjacente ) {
    double  hi = Math.pow(oposto, 2) + Math.pow(adjacente, 2);
double h = Math.sqrt(hi);
    return h;

}
}

Picolo666 commented 1 year ago

FLUXOGRAMA: EM PRODUÇÃO