Is the following Code correct, for calculating Decimal to Triskaidecimal and Triskaidecimal to Decimal, I hope this code is not right
import java.util.Scanner;
public class converter
{
/* 1) Decimal To Triskaidecimal
2) Triskaidecimal To Decimal
3)Exit.
*/
public static void main(String ar[])
{
int a, b;
String s;
System.out.println("Please Select:\n1)Decimal To Triskaidecimal.\n2)Tridecimal To Decimal.\n3)Exit.");
Scanner input = new Scanner(System.in);
s = input.nextLine();
System.out.println("You have Selected:" +s);
switch(s)
{
case "1":
System.out.println("Decimal To Triskaidecimal Conversion:");
Scanner ip_Dec2Tri = new Scanner(System.in);
//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Please Enter A Decimal Number To Convert to Triskaidecimal Number:");
a = ip_Dec2Tri.nextInt();
//String Dec_Hex = br.readLine();
int triskaidecimal = (a%13);
if (triskaidecimal==10)
{
System.out.println("The Decimal To Triskaidecimal is : A");
}
else if (triskaidecimal==11)
{
System.out.println("The Decimal To TriskaiDecimal is : B");
}
else if (triskaidecimal ==12)
{
System.out.println("The Decimal To TriskaiDecimal is : C");
}
else
{
System.out.println("The Decimal To Triskaidecimal is :"+triskaidecimal);
}
break;
case "2":
System.out.println("Triskaidecimal To Decimal Conversion:");
System.out.println("Please Enter a Triskaidecimal Number to Convert it into Decimal:");
Scanner ip_Tri2Dec = new Scanner(System.in);
b = ip_Tri2Dec.nextInt();
int decimal = (b*13);
System.out.println("The Tridecimal To Decimal is : " +decimal);
break;
case "3":
System.out.println("System is Quitting!!!\nThank you for using the converter\n");
System.exit(0);
default:
System.out.println("Please Provide the Correct Input\nTry again!");
System.exit(1);
}//end of switch s
}
}