SlideShare a Scribd company logo
1 of 8
PROBLEMAS PROPUESTOS
11°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto011;
import java.io.*;
/**
*
* @author ERIKA
*/
public class Propuesto011 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
int edad;
BufferedReader in =new BufferedReader(new
InputStreamReader(System.in));
System.out.println("ingresa la edad de cualquier persona");
edad = Integer.parseInt(in.readLine());
if(edad>=18)
System.out.println("la persona es mayor de edad");
else
System.out.println("la persona es menor de edad");
}
}
12°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto012;
import java.io.*;
/**
*
* @author ERIKA
*/
public class Propuesto012 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException {
int n1,n2,m;
BufferedReader in=new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Número 1: ");
n1= Integer.parseInt(in.readLine());
System.out.println("Número 2: ");
n2=Integer.parseInt(in.readLine());
if (n1>n2)
{
m=n2;
}
else
{
m=n1;
}
System.out.println("");
System.out.println("Menor: "+m);
}
}
13°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto013;
import java.io.*;
/**
*
* @author ERIKA
*/
public class Propuesto013 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException{
int a,b;
BufferedReader in=new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Número 1: ");
a= Integer.parseInt(in.readLine());
System.out.println("Número 2: ");
b=Integer.parseInt(in.readLine());
if(a==b)
System.out.println("números son iguales");
else
System.out.println("números son diferentes");
}
}
14°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto014;
import java.util.Scanner;
/**
*
* @author ERIKA
*/
public class Propuesto014 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a,b;
Scanner teclado=new Scanner(System.in);
System.out.print("ESCRIBIR UN NÚMERO:");
a=teclado.nextInt();
//PROCESO
if (a>0){
b=a*2;
}else{
if (a<0){
b=a*3;
}else{
b=0;
}
}
System.out.println("");
System.out.println("EL RESULTADO ES: "+b);
}
}
15°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto015;
import java.util.Scanner;
/**
*
* @author ERIKA
*/
public class Propuesto015 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a,b,c,Ma=0,I=0,Me=0;
Scanner teclado=new Scanner(System.in);
System.out.print("PRIMER NÚMERO:");
a=teclado.nextInt();
System.out.print("SEGUNDO NÚMERO:");
b=teclado.nextInt();
System.out.print("TERCER NÚMERO:");
c=teclado.nextInt();
if (a>b && a>c){
Ma=a;
}else{
if (b>a && b>c){
Ma=b;
}else{
Ma=c;
}
}
if(a<b &&a<c){
Me=a;
}else{
if (b<a&&b<c){
Me=b;
}else{
Me=c;
}
}
I=(a+b+c)-(Ma + Me);
System.out.println("");
System.out.println("ORDEN DESCENDENTE: ");
System.out.println("MAYOR: "+Ma);
System.out.println("INTERMEDIO: "+I);
System.out.println("MENOR: "+Me);
System.out.println("ORDEN ASCENDENTE: ");
System.out.println("MENOR: "+Me);
System.out.println("INTERMEDIO: "+I);
System.out.println("MAYOR: "+Ma);
}
}
16°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto016;
import java.util.Scanner;
/**
*
* @author ERIKA
*/
public class Propuesto016 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a,b,c,d,Pr=0;
String X;
Scanner teclado=new Scanner(System.in);
System.out.print("NOTA 1:");
a=teclado.nextInt();
System.out.print("NOTA 2:");
b=teclado.nextInt();
System.out.print("NOTA 3:");
c=teclado.nextInt();
System.out.print("NOTA 4:");
d=teclado.nextInt();
if(a<b &&a<c && a<d){
Pr=(b+c+d)/3;
}else{
if (b<a&&b<c && b<d){
Pr=(a+c+d)/3;
}else{
if (c<a&&c<b && c<d){
Pr=(a+b+d)/3;
}else{
Pr=(a+b+c)/3;
}
}
}
if(Pr>=11){
X="APROBADO";
}else{
X="DESAPROBADO";
}
System.out.println("");
System.out.println("PROMEDIO: "+Pr);
System.out.println("CONDICIÓN: "+X);
}
}
17°/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto017;
import java.util.Scanner;
/**
*
* @author ERIKA
*/
public class PROPUESTO017 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int sal_ant, monto, sal_actual=0;
char tipo_mov;
Scanner teclado = new Scanner(System.in);
System.out.print("Ingresar el Saldo: ");
sal_ant=teclado.nextInt();
System.out.print("Ingresar el Tipo de Movimiento: ");
tipo_mov = teclado.next().charAt(0);
System.out.print("Ingresar el Monto: ");
monto=teclado.nextInt();
if(tipo_mov=='R'){
sal_actual = sal_ant - monto;
}
else
{
if(tipo_mov=='D'){
sal_actual = sal_ant + monto;
}
}
System.out.println("");
System.out.print("El saldo actual es: "+sal_actual);
System.out.println();
}
}
18°
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package propuesto018;
import java.util.Scanner;
/**
*
* @author ERIKA
*/
public class PROPUESTO018 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int a,b;
String X = "";
Scanner teclado=new Scanner(System.in);
System.out.print("1er Número(A):");
a=teclado.nextInt();
System.out.print("2do Número(B):");
b=teclado.nextInt();
if(a>b){
X = "A es mayor que B";
}else{
if(b>a){
X = "B es Mayor que A";
}
}
if(a==b){
X = "A es igual a B";
}
System.out.println("");
System.out.println("EL RESULTADO ES: " +X);
}
}

More Related Content

What's hot

Антон Полухин. C++17
Антон Полухин. C++17Антон Полухин. C++17
Антон Полухин. C++17Sergey Platonov
 
Import java
Import javaImport java
Import javawildled
 
成果整理表
成果整理表成果整理表
成果整理表neymasem
 
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานโปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานTipprapa Sungsinchai
 
Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8Wilson Su
 
C++14 reflections
C++14 reflections C++14 reflections
C++14 reflections corehard_by
 
Java лаб13
Java лаб13Java лаб13
Java лаб13Enkhee99
 
Bài tập tuần 2
Bài tập tuần 2Bài tập tuần 2
Bài tập tuần 2Cong Nguyen
 

What's hot (12)

Dapan
DapanDapan
Dapan
 
Антон Полухин. C++17
Антон Полухин. C++17Антон Полухин. C++17
Антон Полухин. C++17
 
Import java
Import javaImport java
Import java
 
C#でゲームを作る2016 第1回
C#でゲームを作る2016 第1回C#でゲームを作る2016 第1回
C#でゲームを作る2016 第1回
 
成果整理表
成果整理表成果整理表
成果整理表
 
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐานโปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
โปรแกรมย่อยและฟังก์ชั่นมาตรฐาน
 
Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8Practical JavaScript Programming - Session 3/8
Practical JavaScript Programming - Session 3/8
 
C++14 reflections
C++14 reflections C++14 reflections
C++14 reflections
 
Clinica
ClinicaClinica
Clinica
 
Sbaw090526
Sbaw090526Sbaw090526
Sbaw090526
 
Java лаб13
Java лаб13Java лаб13
Java лаб13
 
Bài tập tuần 2
Bài tập tuần 2Bài tập tuần 2
Bài tập tuần 2
 

Viewers also liked

Viewers also liked (6)

Foursquare
Foursquare Foursquare
Foursquare
 
REPORT CERTIFICATE [ STMD ]
REPORT CERTIFICATE [ STMD ]REPORT CERTIFICATE [ STMD ]
REPORT CERTIFICATE [ STMD ]
 
COCO ABSORB TRIFOLD 1
COCO ABSORB TRIFOLD 1COCO ABSORB TRIFOLD 1
COCO ABSORB TRIFOLD 1
 
635657669400684544
635657669400684544635657669400684544
635657669400684544
 
The State of Crime and Criminal Justice Worldwide
The State of Crime and Criminal Justice WorldwideThe State of Crime and Criminal Justice Worldwide
The State of Crime and Criminal Justice Worldwide
 
Selected Planning Projects
Selected Planning ProjectsSelected Planning Projects
Selected Planning Projects
 

More from Erika Susan Villcas

More from Erika Susan Villcas (13)

Problemas propuestos
Problemas propuestosProblemas propuestos
Problemas propuestos
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Problemas propuestos
Problemas propuestosProblemas propuestos
Problemas propuestos
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Problemas secuenciales.
Problemas secuenciales.Problemas secuenciales.
Problemas secuenciales.
 
Resumen de los capitulos i, ii, iii del libro kendall & kendall
Resumen de los capitulos i, ii, iii del libro kendall & kendallResumen de los capitulos i, ii, iii del libro kendall & kendall
Resumen de los capitulos i, ii, iii del libro kendall & kendall
 
Ejercicios condicionales
Ejercicios condicionalesEjercicios condicionales
Ejercicios condicionales
 
Erika villlcas
Erika villlcasErika villlcas
Erika villlcas
 
Algoritmos condicionales
Algoritmos condicionalesAlgoritmos condicionales
Algoritmos condicionales
 
Algoritmos secuenciales
Algoritmos secuencialesAlgoritmos secuenciales
Algoritmos secuenciales
 
Diseño de boleta, factura, guía de remisión,recibo por honorario,curriculum
Diseño de boleta, factura, guía de remisión,recibo por honorario,curriculumDiseño de boleta, factura, guía de remisión,recibo por honorario,curriculum
Diseño de boleta, factura, guía de remisión,recibo por honorario,curriculum
 

Problemas propuestos

  • 1. PROBLEMAS PROPUESTOS 11° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto011; import java.io.*; /** * * @author ERIKA */ public class Propuesto011 { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { int edad; BufferedReader in =new BufferedReader(new InputStreamReader(System.in)); System.out.println("ingresa la edad de cualquier persona"); edad = Integer.parseInt(in.readLine()); if(edad>=18) System.out.println("la persona es mayor de edad"); else System.out.println("la persona es menor de edad"); } }
  • 2. 12° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto012; import java.io.*; /** * * @author ERIKA */ public class Propuesto012 { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { int n1,n2,m; BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Número 1: "); n1= Integer.parseInt(in.readLine()); System.out.println("Número 2: "); n2=Integer.parseInt(in.readLine()); if (n1>n2) { m=n2; } else { m=n1; } System.out.println(""); System.out.println("Menor: "+m); } }
  • 3. 13° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto013; import java.io.*; /** * * @author ERIKA */ public class Propuesto013 { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException{ int a,b; BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Número 1: "); a= Integer.parseInt(in.readLine()); System.out.println("Número 2: "); b=Integer.parseInt(in.readLine()); if(a==b) System.out.println("números son iguales"); else System.out.println("números son diferentes"); } }
  • 4. 14° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto014; import java.util.Scanner; /** * * @author ERIKA */ public class Propuesto014 { /** * @param args the command line arguments */ public static void main(String[] args) { int a,b; Scanner teclado=new Scanner(System.in); System.out.print("ESCRIBIR UN NÚMERO:"); a=teclado.nextInt(); //PROCESO if (a>0){ b=a*2; }else{ if (a<0){ b=a*3; }else{ b=0; } } System.out.println(""); System.out.println("EL RESULTADO ES: "+b); } }
  • 5. 15° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto015; import java.util.Scanner; /** * * @author ERIKA */ public class Propuesto015 { /** * @param args the command line arguments */ public static void main(String[] args) { int a,b,c,Ma=0,I=0,Me=0; Scanner teclado=new Scanner(System.in); System.out.print("PRIMER NÚMERO:"); a=teclado.nextInt(); System.out.print("SEGUNDO NÚMERO:"); b=teclado.nextInt(); System.out.print("TERCER NÚMERO:"); c=teclado.nextInt(); if (a>b && a>c){ Ma=a; }else{ if (b>a && b>c){ Ma=b; }else{ Ma=c; } } if(a<b &&a<c){ Me=a; }else{ if (b<a&&b<c){ Me=b; }else{ Me=c; } } I=(a+b+c)-(Ma + Me); System.out.println(""); System.out.println("ORDEN DESCENDENTE: "); System.out.println("MAYOR: "+Ma); System.out.println("INTERMEDIO: "+I); System.out.println("MENOR: "+Me); System.out.println("ORDEN ASCENDENTE: "); System.out.println("MENOR: "+Me); System.out.println("INTERMEDIO: "+I);
  • 6. System.out.println("MAYOR: "+Ma); } } 16° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto016; import java.util.Scanner; /** * * @author ERIKA */ public class Propuesto016 { /** * @param args the command line arguments */ public static void main(String[] args) { int a,b,c,d,Pr=0; String X; Scanner teclado=new Scanner(System.in); System.out.print("NOTA 1:"); a=teclado.nextInt(); System.out.print("NOTA 2:"); b=teclado.nextInt(); System.out.print("NOTA 3:"); c=teclado.nextInt(); System.out.print("NOTA 4:"); d=teclado.nextInt(); if(a<b &&a<c && a<d){ Pr=(b+c+d)/3; }else{ if (b<a&&b<c && b<d){ Pr=(a+c+d)/3; }else{ if (c<a&&c<b && c<d){ Pr=(a+b+d)/3; }else{ Pr=(a+b+c)/3; } } } if(Pr>=11){ X="APROBADO"; }else{ X="DESAPROBADO"; } System.out.println("");
  • 7. System.out.println("PROMEDIO: "+Pr); System.out.println("CONDICIÓN: "+X); } } 17°/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto017; import java.util.Scanner; /** * * @author ERIKA */ public class PROPUESTO017 { /** * @param args the command line arguments */ public static void main(String[] args) { int sal_ant, monto, sal_actual=0; char tipo_mov; Scanner teclado = new Scanner(System.in); System.out.print("Ingresar el Saldo: "); sal_ant=teclado.nextInt(); System.out.print("Ingresar el Tipo de Movimiento: "); tipo_mov = teclado.next().charAt(0); System.out.print("Ingresar el Monto: "); monto=teclado.nextInt(); if(tipo_mov=='R'){ sal_actual = sal_ant - monto; } else { if(tipo_mov=='D'){ sal_actual = sal_ant + monto; } } System.out.println(""); System.out.print("El saldo actual es: "+sal_actual); System.out.println(); } }
  • 8. 18° /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package propuesto018; import java.util.Scanner; /** * * @author ERIKA */ public class PROPUESTO018 { /** * @param args the command line arguments */ public static void main(String[] args) { int a,b; String X = ""; Scanner teclado=new Scanner(System.in); System.out.print("1er Número(A):"); a=teclado.nextInt(); System.out.print("2do Número(B):"); b=teclado.nextInt(); if(a>b){ X = "A es mayor que B"; }else{ if(b>a){ X = "B es Mayor que A"; } } if(a==b){ X = "A es igual a B"; } System.out.println(""); System.out.println("EL RESULTADO ES: " +X); } }