Java
Anyone know how to make a Switch statement to ask the user for a number and then convert it to a single Chinese character and print it out?
I just need a small example so I can get started. So far I got the unicode for Chinese characters.
4E8C = 1 in chinese
4E09 = 2
import java.util.Scanner;
public class Test {
public static
void main(String[] args) {
Scanner in = new
Scanner(System.in);
String usersChoise = in.next();
char
result = ' ';
switch (usersChoise.charAt(0)) {
case
'1':
result = 0x4E8C;
break;
case
'2':
result = 0x4E09;
break;
}
System.out.println(Character.toString(result));
}
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
JavaJSPJSF