ejercicios

4
Ejercicios 1) package ejercicio2; import java.io.*; public class Ejercicio2 { public static void main(String[] args)throws IOException{ int v,a,s,o; float vaso; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa v,a,s,o"); v=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); s=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); vaso=v+a+s+o; System.out.println("vaso"+vaso); } } 2). package ejercicio3; import java.io.*; public class Ejercicio3 { public static void main(String[] args)throws IOException{ int c,a,n,t,o; float canto; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa c,a,n,t,o"); c=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); n=Integer.parseInt(in.readLine()); t=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); canto= c+a+n+t+o; System.out.println("canto"+canto); } } 3). package ejercicio4; import java.io.*; public class Ejercicio4 { public static void main(String[] args)throws IOException { int f,l,o,r;

Upload: jhair-aguirre

Post on 10-Aug-2015

17 views

Category:

Economy & Finance


0 download

TRANSCRIPT

Page 1: Ejercicios

Ejercicios

1) package ejercicio2;import java.io.*;public class Ejercicio2 { public static void main(String[] args)throws IOException{ int v,a,s,o; float vaso; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa v,a,s,o"); v=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); s=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); vaso=v+a+s+o; System.out.println("vaso"+vaso); }}2).

package ejercicio3;import java.io.*;public class Ejercicio3 { public static void main(String[] args)throws IOException{ int c,a,n,t,o; float canto; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa c,a,n,t,o"); c=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); n=Integer.parseInt(in.readLine()); t=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); canto= c+a+n+t+o; System.out.println("canto"+canto); }}3).package ejercicio4;

import java.io.*;

public class Ejercicio4 { public static void main(String[] args)throws IOException { int f,l,o,r; float flor; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa f,l,o,r"); f=Integer.parseInt(in.readLine()); l=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); r=Integer.parseInt(in.readLine()); flor= f+l+o+r;

Page 2: Ejercicios

System.out.println("flor"+flor); }}4).package ejercicio5;

import java.io.*;

public class Ejercicio5 { public static void main(String[] args)throws IOException { int s,a,l; float sal; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa s,a,l"); s=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); l=Integer.parseInt(in.readLine()); sal= s+a+l; System.out.println("sal"+sal); }}5).package ejercicio6;

import java.io.*;

public class Ejercicio6 { public static void main(String[] args) throws IOException { int u,n,o; float uno; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa u,n,o"); u=Integer.parseInt(in.readLine()); n=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); uno= u+n+o; System.out.println("uno"+uno); }}6).package ejercicio7;

import java.io.*;

public class Ejercicio7 {

public static void main(String[] args)throws IOException { int t,e,c,l,a; float tecla; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa t,e,c,l,a"); t=Integer.parseInt(in.readLine()); e=Integer.parseInt(in.readLine());

Page 3: Ejercicios

c=Integer.parseInt(in.readLine()); l=Integer.parseInt(in.readLine()); a=Integer.parseInt(in.readLine()); tecla= t+e+c+l+a; System.out.println("tecla"+tecla); }}7).package ejercicio8;

import java.io.*;

public class Ejercicio8 { public static void main(String[] args)throws IOException { int s,o,l; float sol; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa sol"); s=Integer.parseInt(in.readLine()); o=Integer.parseInt(in.readLine()); l=Integer.parseInt(in.readLine()); sol= s+o+l; System.out.println("sol"+sol); }}8).package ejercicio9;

import java.io.*;

public class Ejercicio9 { public static void main(String[] args) throws IOException { int sueldo,descuento; float total; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("sueldo, descuento"); sueldo=Integer.parseInt(in.readLine()); descuento=Integer.parseInt(in.readLine()); total= sueldo-descuento; System.out.println("descuento"+total); }}