/* This program converts an input number from hexadecimal (base 16) to decimal (base 10) * To perform this conversion, convert each digit from 0-9,A-F into 0-15 and add it to * the previous value * 16. For instance, if the input is 123, then 1 converts to 1, * multiply by 16 and add to 2 (18), multiply by 16 and add to 3 = 291. */ import java.util.Scanner; public class Hex2Dec { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print("Enter a hexadecimal number "); String value = in.next(); // get the hex value as a String char temp; // used to store each digit,one at a time int number = 0, temp2 = 0; // number is the converted number (so far) for(int i=0;i