Professional Documents
Culture Documents
Map;
import java.util.Scanner;
import java.util.TreeMap;
public class BIBLIO {
public static void main(String[] args) {
Map<Integer , String> treeMap = new TreeMap < Integer,String>();
treeMap .put(1, "Matematica");
treeMap .put(2, "Ingles");
treeMap .put(3, "Programacion");
treeMap .put(4, "Didactica");
treeMap .put(5, "Psicologia");
treeMap .put(6, "lenguaje");
Scanner sc = new Scanner(System.in);
int a;
System.out.print("Introduza el codigo del libro");
a = sc.nextInt();
treeMap.get(a);
System.out.println(treeMap.get(a));
}
}
package notas;
import java.util.Scanner;
String mensaje;
do {
try {
int valor = 0;
int conta=0;
int conta2=0;
int suma;
int x;
valor = t.nextInt();
arreglo[i] = valor;
for(int i: arreglo){
for(int j=1;j<=7;j=j+2){
conta=conta+ arreglo[j];
System.out.println("\nSuma de pares:"+conta);
for(int k=0;k<=8;k=k+2){
x=arreglo[k]*2;
if(x>=9) {
x=x-9;
conta2=conta2+x;
System.out.print("\nSuma de impares:"+conta2);
suma=conta+conta2;
int res=suma%10;
int res2=10-res;
if(0==arreglo[9]){
System.out.print("\nCorrecto: 0");
else {
if(res2==arreglo[9]){
System.out.print("\nCorrecto: "+res2);
else { System.out.print("\nIncorrecto"+res2);
catch (Exception a) {
System.out.println("\nDesea continuar?:");
mensaje = miScanner.next();
while(!mensaje.equals("n"));
package mayor;
import java.util.Scanner;
try {
n1 = sc.nextInt();
n2 = sc.nextInt();
if(n1<0 || n2<0)
else {
if ( n1 >n2 ) {
if ( n2>n1)
if ( n1==n2)
catch (Exception a) {
import java.util.Scanner;
n = new Scanner(System.in);
double a=0;
try{
a=n.nextDouble();
}catch(Exception e ){
if(a<0)
else {
System.out.println("sobresaliente");
}else {
System.out.println("muy bueno");
}else {
System.out.println("bueno");
}else
System.out.println("regular");
else{
System.out.println("insuficiente");
package ejercicio2;
import java.util.Scanner;
cr = new Scanner(System.in);
double a=0;
System.out.println("Ingrese la nota: ");
try{
a=cr.nextDouble();
catch(Exception e ){
System.out.println("Domina");
}else {
System.out.println("Alcanza");
}else {
System.out.println("No alcanza");
}else {
System.out.println("Supletorio");
package ejercicio2;
import java.util.Scanner;
cr = new Scanner(System.in);
double a=0;
try{
a=cr.nextDouble();
}catch(Exception e ){
System.out.println("sobresaliente");
}else {
System.out.println("muy bueno");
}else {
}else
System.out.println("regular");
}else{
System.out.println("insuficiente");
import java.util.Map;
import java.util.TreeMap;
System.out.println(treeMap);