Sei sulla pagina 1di 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.

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


valor de la disminucin y el nuevo valor que toma el nmero ingresado.

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).
Antes de enviar utiliza NETBEANS para comprobar el funcionamiento de
tu aplicacin.

SOLUCION:
PROYECTO NOTAS:
DIAGRAMA DE FLUJO:

PSEUDOCODIGO:
Inicio
Escribir 'Ingrese las 3 notas del Alumno'
Escribir 'Ingrese la Primera Nota'
Leer Nota1
Escribir 'Ingrese la Segunda Nota'
Leer Nota2
Escribir 'Ingrese la Tercera Nota'
Leer Nota3
Prom=(Nota1+Nota2+Nota3)/3
Escribir 'El Promedio del Alumno es:
Escribir prom
Fin

CODIGO JAVA:
// kevin callupe mucha
package notas;
import javax.swing.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
public static void main(String[] args) {
String al1,al2,al3,D;
double P;
double A;
double B;
double C;
D= JOptionPane.showInputDialog("Ingrese el Nombre del Alumno:");
al1= JOptionPane.showInputDialog("Ingrese Primera Nota:");
al2= JOptionPane.showInputDialog("Ingrese Segunda Nota:");
al3= JOptionPane.showInputDialog("Ingrese Tercera Nota:");
A= Double.parseDouble(al1);

B= Double.parseDouble(al2);
C= Double.parseDouble(al3);
P= (A+B+C)/3;
BigDecimal bigDecimal = new BigDecimal(P);
BigDecimal prom = bigDecimal.setScale(0, RoundingMode.HALF_UP);
JOptionPane.showMessageDialog(null, "El Promedio del Alumno "+D+" es: "+prom);
System.exit( 0 );
}
}

SOLUCION:
PROYECTO NMERO:
DIAGRAMA DE FLUJO:

PSEUDOCODIGO:
Inicio
Escribir Ingrese el Numero
Leer Num
Por=Num*0.30
Res=Num-Por
Escribir El porcentaje es: , Por, y el Nuevo Valor es: ,Res
Fin
CODIGO JAVA:
// kevin callupe mucha
package numero;
import javax.swing.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
public static void main(String[] args) {
String d;
int N;
double p,r;
d=JOptionPane.showInputDialog("Ingrese el Nmero:");
N=Integer.parseInt(d);
p=N*0.30;
r=N-p;
BigDecimal bigDecimal = new BigDecimal(p);
BigDecimal bigDecimal2 = new BigDecimal(r);
BigDecimal por = bigDecimal.setScale(0, RoundingMode.HALF_UP);
BigDecimal res = bigDecimal2.setScale(0, RoundingMode.HALF_UP);
JOptionPane.showMessageDialog(null, "El Porcentaje es "+por+"\nEl Nuevo
Valor es "+res);
System.exit( 0 );
}
}

SOLUCION:
PROYECTO PAGOS:
DIAGRAMA DE FLUJO:

PSEUDOCODIGO:
Inicio
Escribir 'Ingrese los segundos consumidos'
Leer segundos
Tar=segundos*0.0133
Igv=tar*0.18
Total=tar+igv
Escribir 'El tiempo consumido es ',segundos,' segundos y el Monto a
Pagar es S/. ',total
Fin

CODIGO JAVA:
// kevin callupe mucha
package pagos;
import javax.swing.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class Main {
public static void main(String[] args) {
String d;
int seg;
double tar,igv,total;
d=JOptionPane.showInputDialog("Ingrese los Segundos\n Consumidos:");
seg=Integer.parseInt(d);
tar=seg*0.0133;
igv=tar*0.18;
total=tar+igv;
BigDecimal bigDecimal = new BigDecimal(total);
BigDecimal red = bigDecimal.setScale(2, RoundingMode.HALF_UP);
JOptionPane.showMessageDialog(null, "El tiempo consumido es "+seg+"
segundos\nEl Monto Total a Pagar es S/. "+red);
System.exit( 0 );
}
}

Potrebbero piacerti anche