Your SlideShare is downloading. ×
Trabajo de programacion
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Trabajo de programacion

312
views

Published on

Programas en java

Programas en java

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
312
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. TRABAJO DE PROGRAMACION NOMBRE: ANDRES BOLANIOS CURSO:SEGUNDO SISTEMA EJERCICIO 1 public class EJERCICIO1 { static public Scanner entrada=new Scanner(System.in); static double A=0; static double B=0; static double resultado=0; public static void main(String[] args) { ingrese() resultado(a+b)/3 imprimir("("+A+"+"+B+")/3:"+resultado) public static void ingresar() { System.out.print("ingrese el valor de A"); A=entrada.nextDouble(); System.out.print("ingrese el valor de B"); B=entrada.nextDouble(); } public static void resultado () { resultado=(A+B)/3; }
  • 2. public static void imprimir() { System.out.println("("+A+"+"+B+")/3:"+resultado); } EJERCICIO2 public class EJERCICIO2 { static public Scanner entrada=new Scanner(System.in); static double N_1=0; static double N_2=0; static double N_3=0; static double sum=0; static double prom=0; public static void main(String[] args) { ingresar() operacion=(sum,prom); System.out.println(imprimir(prom)); public static void ingresar(){ System.out.print("ingrese la nota uno"); N_1=entrada.nextInt(); System.out.print("ingrese la nota dos"); N_2=entrada.nextInt(); System.out.print("ingrese la nota tres"); N_3=entrada.nextInt(); }
  • 3. public static void operacion(double n1,double n2,double n3){ sum=N_1+N_2+N_3; prom=(sum)/3; } public static void imprimir(){ System.out.println("("+N_1+"+"+N_2+"+"+N_3+")/3:" + prom); } } EJERCICIO 3 public class EJERCICIO3 { static public Scanner entrada=new Scanner(System.in); static double N_1=0; static double cuadrado=0; static double cubo=0; public static void main(String[] args) { ingresar (); calcular (cuadrado,cubo); System.out.printlnimprimir(cuadrado); System.out.printlnimprimir(cubo); publicestatic void ingresar(){ System.out.print("ingrese un numero"); N-1=entrada.nextInt(); } public static void calcular(double cubo,doublecuadrado){
  • 4. returncuadrado=N1*N1; returncubo=N_1*N_1*N_1; } public static void imprimir(){ returnSystem.out.println("("+N1+"*"+N1+"):" + cuadrado); returnSystem.out.println("("+N1+"*"+N1+"*"+N1+"):" + cubo); } } EJERCICIO4 public class EJERCICIO4 { static public Scanner entrada=new Scanner(System.in); static double B=0; static double A=0; static double area=0; static double perimetro=0; public static void main(String[] args) { ingresar(); calcular=calculo(area); calcular=calculo(perimetro); System.out.printlnimprimir( area); System.out.printlnimprimir(perimetro); public static ingresar(){ System.out.print("ingrese la base del rectangulo");
  • 5. B=entrada.nextInt(); System.out.print("ingrese la altura del rectangulo"); A=entrada.nextInt(); public static calculo(area,perimetro){ area=(B*A); perimetro=(B*2+A*2); } public static void imprimir(){ System.out.println("("+B+"*"+A+"):" + area); System.out.println("("+B+"*"+2+"+"+A+"*"+2+"):" + perimetro); } } EJERCICIO 5 public class EJERCICIO5 { static public Scanner entrada=new Scanner(System.in); static double total=0; static double moneda pesos=0; static double valor_pesos=10.75; public static void main(String[] args) { ingrese(); op=op(moneda_pesos); System.out.println(imprimir(total)); public static void ingrese(){ System.out.println("ingrese el total a transformar");
  • 6. moneda_pesos=entrada.nextDouble(); } public static void op(double moneda_pesos){ total=moneda_pesos/valor_pesos; } public static voiimprimir(){ System.out.println("("+moneda_pesos+"/"+valor_pesos+"):" + total); } } EJERCICIO 6 public class EJERCICIO6 { static public Scanner entrada=new Scanner(System.in); static double GL=0; static double Cantidad=0; static double LT=3.78; public static void main(String[] args) { public static void ingresar(){ System.out.println("ingrese la cantidad de galones"); GL=entrada.nextDouble(); } public static void calculo(double GL, double LT){ Cantidad=GL*LT; }
  • 7. public static void imprimir(){ System.out.println("("+GL+"*"+LT+"):" + Cantidad); } } EJERCICIO7 public class EJERCICIO7{ public static Scanner sc=new Scanner(System.in); public static double linea1,linea2,linea3,area; public static void main(String[] args) { ingresar(); resultado=resultado(linea1,linea2,linea3); System.out.println(imprimir(area)); } public static void ingresar(){ System.out.print("ingrese el lado 1"); linea1=sc.nextInt(); System.out.print("ingrese el lado 2"); linea2=sc.nextInt(); System.out.print("ingrese el lado 3"); linea3=sc.nextInt(); } public static intcalculo(double linea1,double linea2,double linea3 ){ return (linea1+linea2+linea3)/2; }
  • 8. public static String imprimir(double area){ return "Su area es: "+resultado; } } EJERCICIO8 public class EJERCICIO8 { public static Scanner sc=new Scanner(System.in); public static double centigrados,fahrenheit; public static void main(String[] args) { ingresar(); cambio=calculo(cent,fahr); System.out.println(imprimir(fahr)); } public static void ingresar(){ System.out.print("ingrese los gradoscentigrados"); cents=sc.nextInt(); } public static intcalculo(intcent,intfahr ){ return ((cent*5)/9)+32; } public static String imprimir(intfahr){ return "Su temperaturaes:" + fahr; } }