Está en la página 1de 10

/*

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

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad

*/

public class Ejercicio2 {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Scanner entrada = new Scanner (System.in);

int hora,min,segundos,segundostotal;

double costototal;

final double costo = 0.25;

System.out.println("Cuantas horas va a tardar");

hora = entrada.nextInt();

System.out.println("Cuantos minumos mas va a tardar");

min = entrada.nextInt();
System.out.println("Cuantos segundos mas va a tardar");

segundos = entrada.nextInt();

segundostotal = hora*60*60+min*60+segundos;

costototal = segundostotal*costo;

System.out.println("El tiempo es "+hora+" horas "+min+" minutos "+segundos+"


segundos");

System.out.println("El costo por segundo es "+costo+"$");

System.out.println("El costo total es "+costototal+"$");

/*

*
To

change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad

*/

public class Ejercicios3 {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {


// TODO code application logic here

double ancho,largo;

Scanner entrada = new Scanner (System.in);

double l,a,perimetro,hilo,area,h,q;

System.out.println("Escriba el largo del campo (en metros)");

l = entrada.nextDouble();

System.out.println("Escriba el ancho del campo (en metros)");

a = entrada.nextDouble();

perimetro = l*2+a*2;

hilo= perimetro*5;

area = l*a;

h = area/10000;

q = 145 * h;

System.out.println("La cantidad necesaria de hilo sera "+hilo);

System.out.println("La produccion de quintales sera de "+q);

/*

*
To

change this license header, choose License Headers in Project Properties.

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad
*/

public class Ejercicio4 {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Scanner entrada = new Scanner (System.in);

double l,a,m3;

final double arena= 0.5;

System.out.println("Ingrese el largo de la pared ");

l = entrada.nextDouble();

System.out.println("Ingrese el alto de la pared ");

a = entrada.nextDouble();

m3 = arena*l*a;

System.out.println("La cantidad de metros cubicos necesarios seran "+m3);

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

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad

*/

public class Ejercicios {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Scanner entrada = new Scanner (System.in);

String resultado;

double a,b;

System.out.println("Escriba el tipo de operacion (+,-,*,/)");

resultado = entrada.nextLine();

System.out.println("Escriba el primer numero");

a = entrada.nextDouble();

System.out.println("Escriba el segundo numero");

b = entrada.nextDouble();

if (resultado.equals("+")) {

System.out.println(a+b);

}else{

if (resultado.equals("/")) {

System.out.println(a/b);

}else{
if (resultado.equals("*")) {

System.out.println(a*b);

}else{

if (resultado.equals("-")) {

System.out.println(a-b);

}else{

System.out.println("Simbolo incorrecto");

/*

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

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad

*/

public class NewMain {

/**
* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Scanner entrada = new Scanner (System.in);

double x,y,dist;

System.out.println("Escriba el valor de x");

x= entrada.nextDouble();

System.out.println("Escriba el valor de y");

y= entrada.nextDouble();

dist = Math.pow(Math.pow(x, 2)+ Math.pow(y, 2), 1/2);

if (x>0&&y>0) {

System.out.println("La recta esta en el primer cuadrante");

}else{

if (x<=0&&y<0) {

System.out.println("La recta esta en el tercer cuadrante");

}else{

if (x>0&&y<0) {

System.out.println("La recta esta en el cuarto cuadrante");

}else{

if (x<0&&y>0) {

System.out.println("La recta esta en el segundo cuadrante");

}else{

System.out.println("La recta no esta en ningun cuadrante");

}
}

/*

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

* To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

package ejercicios;

import java.util.Scanner;

/**

* @author jorad

*/

public class NewMain1 {

/**

* @param args the command line arguments

*/

public static void main(String[] args) {

// TODO code application logic here

Scanner entrada = new Scanner (System.in);

double sueldo,bonificacion;

int tiempo,estado;

System.out.println("Cual es su sueldo");

sueldo = entrada.nextDouble();
System.out.println("Cual es su estado civil (soltero=1,casado=2)");

estado = entrada.nextInt();

System.out.println("Cuantos años a trabajado");

tiempo = entrada.nextInt();

if (estado==1) {

if (tiempo==5) {

System.out.println("La bonificacion es "+sueldo*2/100);

}else{

if (tiempo>=6&&tiempo<=10) {

System.out.println("La bonificacion es "+sueldo*5/100);

}else

if (tiempo>10) {

System.out.println("La bonificacion es "+sueldo*10/100);

if (estado==2) {

if (tiempo==5) {

System.out.println("La bonificacion es "+sueldo*5/100);

}else{

if (tiempo>=6&&tiempo<=10) {

System.out.println("La bonificacion es "+sueldo*10/100);

}else

if (tiempo>10) {

System.out.println("La bonificacion es "+sueldo*1/100);

También podría gustarte