How to convert a Java source code into a data flow diagram

922 views Asked by At

What is the best method to convert java source code into a data flow diagram? And also is there any method to identify the main elements in a data flow diagram by referring the java source code programmatically.

1

There are 1 answers

1
brandy merino On

public class Pregunta1 {

public static void main(String[] args) {

    Scanner teclado = new Scanner(System.in);

    String alumno;
    double n1, n2, n3, promedio;

    System.out.print("Nombre de alumno: ");
    alumno = teclado.nextLine();
    System.out.print("Nota1: ");
    n1 = Double.parseDouble(teclado.nextLine());
    System.out.print("Nota1: ");
    n2 = Double.parseDouble(teclado.nextLine());
    System.out.print("Nota1: ");
    n3 = Double.parseDouble(teclado.nextLine());

    promedio = (n1 + n2 + n3) / 3;
    System.out.println("promedio: " + promedio);

    if (promedio >= 7) {
        System.out.println("Promocionado");
    } else if (promedio >= 4 && promedio < 7) {
        System.out.println("Regular");
    } else if (promedio < 4) {
        System.out.println("Reprobado");
    }
}

}