Está en la página 1de 6

INSTRUCCIONES

Construye

los

algoritmos

computacionales

con

sus

respectivas

codificaciones en Java (elabora para cada proyecto: Diagrama de flujo,


pseudocdigo y cdigo) para resolver los siguientes requerimientos:

1. Proyecto NOTAS: INGRESE el nombre y 3 notas de un alumno, calcular y


mostrar el promedio del alumno.
PSEUDOCODIGO:
Inicio
Escribir 'Ingrese nombre de Alumno'
Escribir 'Ingrese la Primera Nota'
Leer Nota1
Escribir 'Ingrese la Segunda Nota'
Leer Nota2
Escribir 'Ingrese la Tercera Nota'
Leer Nota3
Promedio = (Nota1+Nota2+Nota3)/3
Escribir 'El Promedio del Alumno es:
Escribir Promedio
Fin
CDIGO JAVA:

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

3 * To change this template file, choose Tools | Templates


4 * and open the template in the editor.
5 */
6 package proyecto_notas;
7
8 import javax.swing.JOptionPane;
9
10 /**
11 *
12 * @author Romain Torre Zuiga
13 */
14 public class Proyecto_NOTAS1 {
15
16
/**
17
* @param args the command line arguments
18
*/
19
public static void main(String[] args) {
20
// TODO code application logic here
21
// Declaracion de variables
22
// double = decimal
23
double n1, n2, n3, P;
24
// string = (clase) cadena de texto, el sistema pide
entrada de texto
25
String nn1, nn2, nn3, na;
26
// Entrada de datos
27
na = JOptionPane.showInputDialog("Ingrese nombre
del alumno");
28
nn1 = JOptionPane.showInputDialog("Ingrese
primeara nota");
29
nn2 = JOptionPane.showInputDialog("Ingrese
segunda nota");
30
nn3 = JOptionPane.showInputDialog("Ingrese tercera
nota");
31
//Conversion de datos (String a double)
32
n1 = Double.parseDouble(nn1);
33
n2 = Double.parseDouble(nn2);
34
n3 = Double.parseDouble(nn3);
35
//Proceso
36
P = (n1 + n2 + n3) / 3;
37
//Salida
38
System.out.println("El promedio del alumno " + na
+ " es: " + P);

39
}
40 }

2. Proyecto NMERO: Ingrese un nmero, disminyalo en 30%, mostrar el


valor de la disminucin y el nuevo valor que toma el nmero ingresado.
PSEUDOCODIGO:
Inicio
Escribir Ingrese el Numero
Leer Nmero
Por = Numero*0.30
N. Valor = Numero-Porcentaje
Escribir El porcentaje es: , Por, y el Nuevo Valor es: ,N. Valor
Fin
CDIGO JAVA:

1 /*
2 * To change this license header, choose License Headers in
Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6 package proyecto_notas;
7
8 import javax.swing.JOptionPane;
9
10 /**
11 *
12 * @author Romain Torre Zuiga
13 */
14 public class Proyecto_Numero {

15
16
/**
17
* @param args the command line arguments
18
*/
19
public static void main(String[] args) {
20
// TODO code application logic here
21
// Declaracion de variables
22
// double = decimal
23
double N, P, NV;
24
// string = (clase) cadena de texto, el sistema pide
entrada de texto
25
String N1;
26
// Entrada de datos
27
N1 = JOptionPane.showInputDialog("Ingrese
numero");
28
//Conversion de datos (String a double)
29
N = Double.parseDouble(N1);
30
//Proceso
31
P = N * 0.30;
32
NV = N - P;
33
//Salida
34
System.out.println("El valor ingresado es: " + N +
"\nEl porcentaje o disminucion es: " + P + "\nEl nuevo valor
es " + NV);
35
}
36 }

3. Proyecto PAGOS: Construya un programa que calcule el monto a pagar por


el servicio de telefona celular, el pago se har sobre la base de los
segundos de uso del servicio. Por cada segundo el servicio cuesta: S/.
0.0133 (al monto resultante se debe incrementar el IGV).
PSEUDOCODIGO:
Inicio
Escribir 'Ingrese segundos consumidos'

Leer segundos
Total = segundos*0.0133
IGV = Total * 0.18
T. a pagar = Total + IGV
Escribir 'El tiempo consumido es ',Segundos,' Segundos y el Total a
Pagar es S/. ',T. a pagar
Fin
CDIGO JAVA:

1 /*
2 * To change this license header, choose License Headers
in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6 package proyecto_notas;
7
8 import javax.swing.JOptionPane;
9
10 /**
11 *
12 * @author Romain Torre zuiga
13 */
14 public class Proyecto_Pagos {
15
16
/**
17
* @param args the command line arguments
18
*/
19
public static void main(String[] args) {
20
// TODO code application logic here
21
// Declaracion de variables
22
// double = decimal
23
double S, T, IGV, TP;
24
// string = (clase) cadena de texto, el sistema pide
entrada de texto
25
String S1;
26
// Entrada de datos

27
S1 = JOptionPane.showInputDialog("Ingrese segundos
consumidos");
28
//Conversion de datos (String a double)
29
S = Double.parseDouble(S1);
30
//Proceso
31
T = S * 0.0133;
32
IGV = T * 0.18;
33
TP = T + IGV;
34
//Salida
35
System.out.println("Segundos Ingresados: " + S +
"\nA pagar: " + T + "\nEl igv es: " + IGV + "\nTotal a Pagar: "
+ TP);
36
}
37 }

Antes de enviar utiliza NETBEANS para comprobar el funcionamiento de tu


aplicacin.

También podría gustarte