algoritmo para saber el signo zodiacal con sentencias
switch
import java.io.*;
class switchr_2{
public static void main(String args[])throws IOException{
int dia,ms;
BufferedReader in=new BufferedReader(new
InputStreamReader(System.in));
System.out.println("Programa que muestra el signo el
zodiaco");
System.out.println("Escriba numero de mes de
nacimiento: ");
ms=Integer.parseInt(in.readLine());
System.out.println("Escriba numero del dia de
naciminto: ");
dia=Integer.parseInt(in.readLine());
switch(ms)
<!--more-->
{
case 1:
if(dia<2 capricornio="capricornio"
system.out.println="system.out.println">
else{ System.out.println(" acuario");}
break;
case 2:
if(dia<20 acuario="acuario"
system.out.println="system.out.println">
else{ System.out.println(" piscis");}
break;
case 3:
if(dia<21 piscis="piscis"
system.out.println="system.out.println">
else{ System.out.println("aries");}
break;
case 4:
if(dia<21 aries="aries"
system.out.println="system.out.println">
else{ System.out.println(" tauro");}
break;
case 5:
if(dia<21 system.out.println="system.out.println"
tauro="tauro">
else{ System.out.println(" geminis");}
break;
case 6:
if(dia<22 geminis="geminis"
system.out.println="system.out.println">
else{ System.out.println(" cancer");}
break;
case 7:
if(dia<23 cancer="cancer"
system.out.println="system.out.println">
else{ System.out.println(" leo");}
break;
case 8:
if(dia<23 leo="leo"
system.out.println="system.out.println">
else{ System.out.println(" virgo");}
break;
case 9:
if(dia<23 system.out.println="system.out.println"
virgo="virgo">
else{ System.out.println(" libra");}
break;
case 10:
if(dia<23 libra="libra"
system.out.println="system.out.println">
else{ System.out.println(" escorpio");}
break;
case 11:
if(dia<22 escorpio="escorpio"
system.out.println="system.out.println">
else{ System.out.println(" sagitario");}
break;
case 12:
if(dia<22 sagitario="sagitario"
system.out.println="system.out.println">
else{ System.out.println(" capricornio");}
break;
default:System.out.println(" mes incorrecto");
}
}
}