If else statement for Dungeon and dragon
Im trying to make it so when you place a number between 1-20 the value for dnd is place in the box above.
DND values:
0,1 = -5
2,3 = -4
4,5 = -3
6,7 = -2
8,9 = -1
10,11 = 0
12,13 = +1
14,15 = +2
16,17 = +3
18,19 = +4
20 = +5


I have a if statement already made but i copied if from a different website and just modified to what i need. I'm not sure how to make x the str field and the print out to STRmod field. Thank you for your help
public class Test {
public static void main(String args[]) {
int x = 0;
if( x == 0 ) {
System.out.print(-5);
}else if( x == 1 ) {
System.out.print(-5);
}else if( x == 2 ) {
System.out.print(-4);
}else if( x == 3 ) {
System.out.print(-4);
}else if( x == 4 ) {
System.out.print(-3);
}else if( x == 5 ) {
System.out.print(-3);
}else if( x == 6 ) {
System.out.print(-2);
}else if( x == 7 ) {
System.out.print(-2);
}else if( x == 8 ) {
System.out.print(-1);
}else if( x == 9 ) {
System.out.print(-1);
}else if( x == 10 ) {
System.out.print(0);
}else if( x == 11 ) {
System.out.print(0);
}else if( x == 12 ) {
System.out.print(+1);
}else if( x == 13 ) {
System.out.print(+1);
}else if( x == 14 ) {
System.out.print(+2);
}else if( x == 15 ) {
System.out.print(+2);
}else if( x == 16 ) {
System.out.print(+3);
}else if( x == 17 ) {
System.out.print(+3);
}else if( x == 18 ) {
System.out.print(+4);
}else if( x == 19 ) {
System.out.print(+4);
}else if( x == 20 ) {
System.out.print(+5);
}
}
}
