ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Actividad 2 Sena Variable Java


Enviado por   •  23 de Abril de 2022  •  Tareas  •  1.000 Palabras (4 Páginas)  •  76 Visitas

Página 1 de 4

/*

* To change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package notas;

import java.util.Scanner;

/**

*

* @author milto

*/

public class Notas {

/**

* @param args the command line arguments

*/

@SuppressWarnings("empty-statement")

public static void main(String[] args) {

int menu, m, e=1, i=1, alumnos;

double notas, notas2, notas3, total=0, total2=0, total3=0, promedio=0, promedio1=0, Promedio2=0;

Scanner r = new Scanner(System.in);

System.out.println("Ingrese 1 para calcular promedio de notas:");

menu =r.nextInt();

switch (menu)

{

case 1:

System.out.println("ingrese la cantidad de alumnos:");

alumnos =r.nextInt();

System.out.println("\nLa cantidad de alumnos es:"+alumnos);

for(m=1; m<=alumnos; m++)

{

System.out.println("Ingrese la nota del alumno" + m + "en la materia de matématicas");

notas= r.nextDouble();

total= total + notas;

promedio= total/alumnos;

}

while (e<=alumnos)

{

System.out.println("Ingrese la nota del alumno" + e++ +"En la materia de español");

notas2= r.nextDouble();

total2= total2 + notas2;

promedio1=total2/alumnos;

}

do

{

System.out.println("ingrese la nota del alumno"+ i++ +"En la materia de ingles");

notas3= r.nextDouble();

total3= total3 + notas3;

Promedio2=total3/alumnos;

}

while (i<=alumnos);

System.out.println("El promedio de matématicas es:"+ promedio);

System.out.println("El promedio de español es:"+

...

Descargar como (para miembros actualizados) txt (2 Kb) pdf (36 Kb) docx (8 Kb)
Leer 3 páginas más »
Disponible sólo en Clubensayos.com