java program Display the ASII character table\". It is table B.1 that we want to
ID: 3742966 • Letter: J
Question
java program
Display the ASII character table". It is table B.1 that we want to make. From this table, we want to print the following output:
|
0
1
2
3
4
5
6
7
8
9
-
+
-
-
-
-
-
-
-
-
-
-
3
|
!
“
#
$
%
&
'
4
|
(
)
*
+
,
-
.
/
0
1
5
|
2
3
4
5
6
7
8
9
:
;
6
|
<
=
>
?
@
A
B
C
D
E
7
|
F
G
H
I
J
K
L
M
N
O
8
|
P
Q
R
S
T
U
V
W
X
Y
9
|
Z
[
]
^
_
`
a
b
c
10
|
d
e
f
g
h
i
j
k
l
m
11
|
n
o
p
q
r
s
t
u
v
w
12
|
x
y
z
{
|
}
~
This will take a little planning on your part to start your loops at the correct starting value.
|
0
1
2
3
4
5
6
7
8
9
-
+
-
-
-
-
-
-
-
-
-
-
3
|
!
“
#
$
%
&
'
4
|
(
)
*
+
,
-
.
/
0
1
5
|
2
3
4
5
6
7
8
9
:
;
6
|
<
=
>
?
@
A
B
C
D
E
7
|
F
G
H
I
J
K
L
M
N
O
8
|
P
Q
R
S
T
U
V
W
X
Y
9
|
Z
[
]
^
_
`
a
b
c
10
|
d
e
f
g
h
i
j
k
l
m
11
|
n
o
p
q
r
s
t
u
v
w
12
|
x
y
z
{
|
}
~
Explanation / Answer
ASCIITable.java
public class ASCIITable {
public static void main(String[] args) {
// Declaring variables
char ch;
int temp;
// Displaying the ASCII table
System.out.print(" | ");
for (int i = 0; i <= 9; i++) {
System.out.print(i + " ");
}
System.out.print(" - + ");
for (int i = 0; i <= 9; i++) {
System.out.print("-" + " ");
}
System.out.println();
for (int i = 3; i <= 12; i++) {
System.out.print((i) + " | ");
for (int j = 0; j <= 9; j++) {
temp = j + (i * 10);
ch = (char) temp;
if (temp <= 126)
System.out.print(ch + " ");
else
System.out.print(" " + " ");
}
System.out.println();
}
}
}
______________
Output:
| 0 1 2 3 4 5 6 7 8 9
- + - - - - - - - - - -
3 | ! " # $ % & '
4 | ( ) * + , - . / 0 1
5 | 2 3 4 5 6 7 8 9 : ;
6 | < = > ? @ A B C D E
7 | F G H I J K L M N O
8 | P Q R S T U V W X Y
9 | Z [ ] ^ _ ` a b c
10 | d e f g h i j k l m
11 | n o p q r s t u v w
12 | x y z { | } ~
____________Thank You
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.