Instrucciones 1

7
INSTRUCCIONES Construye los algoritmos computacionales con sus respectivas codificaciones en Java (elabora para cada proyecto: Diagrama de flujo, pseudocódigo y código) 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

description

tarea

Transcript of Instrucciones 1

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:

InicioEscribir 'Ingrese nombre de Alumno'Escribir 'Ingrese la Primera Nota'Leer Nota1Escribir 'Ingrese la Segunda Nota'Leer Nota2Escribir 'Ingrese la Tercera Nota'Leer Nota3Promedio = (Nota1+Nota2+Nota3)/3Escribir 'El Promedio del Alumno es:Escribir PromedioFin

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 Zuiga13 */14 public class Proyecto_NOTAS1 {15 16 /**17 * @param args the command line arguments18 */19 public static void main(String[] args) {20 // TODO code application logic here21 // Declaracion de variables22 // double = decimal23 double n1, n2, n3, P;24 // string = (clase) cadena de texto, el sistema pide entrada de texto25 String nn1, nn2, nn3, na;26 // Entrada de datos27 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 //Proceso36 P = (n1 + n2 + n3) / 3;37 //Salida38 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:

InicioEscribir Ingrese el NumeroLeer NmeroPor = Numero*0.30 N. Valor = Numero-PorcentajeEscribir El porcentaje es: , Por, y el Nuevo Valor es: ,N. ValorFin

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 Zuiga13 */14 public class Proyecto_Numero {15 16 /**17 * @param args the command line arguments18 */19 public static void main(String[] args) {20 // TODO code application logic here21 // Declaracion de variables22 // double = decimal23 double N, P, NV;24 // string = (clase) cadena de texto, el sistema pide entrada de texto25 String N1;26 // Entrada de datos27 N1 = JOptionPane.showInputDialog("Ingrese numero");28 //Conversion de datos (String a double)29 N = Double.parseDouble(N1);30 //Proceso31 P = N * 0.30;32 NV = N - P;33 //Salida34 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:

InicioEscribir 'Ingrese segundos consumidos'Leer segundosTotal = segundos*0.0133IGV = Total * 0.18T. a pagar = Total + IGV Escribir 'El tiempo consumido es ',Segundos,' Segundos y el Total a Pagar es S/. ',T. a pagarFin

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 zuiga13 */14 public class Proyecto_Pagos {15 16 /**17 * @param args the command line arguments18 */19 public static void main(String[] args) {20 // TODO code application logic here21 // Declaracion de variables22 // double = decimal23 double S, T, IGV, TP;24 // string = (clase) cadena de texto, el sistema pide entrada de texto25 String S1;26 // Entrada de datos27 S1 = JOptionPane.showInputDialog("Ingrese segundos consumidos");28 //Conversion de datos (String a double)29 S = Double.parseDouble(S1);30 //Proceso31 T = S * 0.0133;32 IGV = T * 0.18;33 TP = T + IGV;34 //Salida35 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.