-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalcPromedio.java
More file actions
38 lines (26 loc) · 931 Bytes
/
Copy pathCalcPromedio.java
File metadata and controls
38 lines (26 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package calcpromedio;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class CalcPromedio{
static int conteo = 0;
static int nota = 0;
static String seguir = "S";
static Console con = System.console();
public static void main (String[] args){
System.out.println("CALCULAR PROMEDIO DE CALIFICACIONES");
//con.readLine("enter value");
while (seguir.equals("S")){
System.out.println("Favor ingresar la calificacion obtenida");
nota = nota+(Integer.parseInt(con.readLine()));
System.out.println("Desea ingresar otra calificacion S:si/N:no");
seguir = con.readLine();
seguir = seguir.trim();
seguir = seguir.toUpperCase();
conteo++;
}//end loop
System.out.println("El promedio de sus calificaciones es "+(nota/conteo));
con.readLine();
}
}//(seguir.toUpperCase() == "S")