Compiler Construction Assignment
Compiler Construction Assignment
package hexconverter;
import java.util.*;
/**
* @author Steven
*/
String hex;
hex = scanner.next();
hex = hex.toUpperCase();
long count = 1;
long ans = 0;
Character c = hex.charAt(i);
if (c != '1' && c != '2' && c != '3' && c != '4' && c != '5' &&
c != '6' && c != '7' && c != '8' && c != '9') {
} else {
String s = c.toString(c);
System.out.println("is negative");
} else {
System.out.println(ans);
if (c.equals('A')) {
return 10;
} else if (c.equals('B')) {
return 11;
} else if (c.equals('C')) {
return 12;
} else if (c.equals('D')) {
return 13;
} else if (c.equals('E')) {
return 14;
} else if (c.equals('F')) {
return 15;
} else {
return 0;
} }
a.doWork(); }