0

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.

Tharindu Pradeep
  • 1,152
  • 11
  • 16

1 Answers1

0

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

}

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – alea May 18 '23 at 06:04