Java Assignment 2
Java Assignment 2
1 + 20
* 2 /
Sample output:
.
.
.
.
.
.
-------------------------------------------Do you want to continue(y/x): x
(Exit from program)
3. From the above program String Arrays A and B with size 1000 values has to generate the bitmaps
as shown below. Use the bitmaps generated from A and B, Program has to generate the output pair
of values according to the threshold value given by the user based on the
bitCount of the pairs.
Sample output:
Strings generated for A and B arrays are:
S.no.
-----1
2
3
4
5
6
.
.
1000
A
--A1
A2
A1
A3
A5
A4
.
.
A5
B
--B1
B1
B2
B2
B1
B2
.
.
B1
A2
0
1
0
0
0
0
.
.
.
A3
0
0
0
1
0
0
.
.
.
A4
0
0
0
0
0
1
.
.
.
A5
0
0
0
0
1
0
.
.
.
B1
1
1
0
0
1
0
.
.
.
B2
0
0
1
1
0
1
.
.
.
B3
0
0
0
0
0
0
.
.
.
B4
0
0
0
0
0
0
.
.
.
B5
0
0
0
0
0
0
.
.
.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* E
The program has to start from S and reaches to end E by finding the empty spaces. Create your
own 2-d array which has the filled values as shown above. Use the direction keys
(d- Down
r-Right
l-Left
r-Right)
to move the symbol S. And also fill the empty spaces which are visited with . symbol. Program
has to quit when it finds the path from S to E
Example: Take the input from the user as following format:
<Direction Key> <number of moves>
Ex: d 5 (which moves S Down to 5 spaces).
Sample Output is as shown below:
1. Command: D 5
2. Command: R 3
.
.
.
.
.
S
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
.
.
.
.
.
.
*
*
3.Command: U 3
.
.
.
.
.
.
*
*
*
*
*
*
*
.
*
*
*
*
*
*
*
.
*
*
*
*
S
.
.
.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
.
*
*
*
*
*
*
*
.
*
*
*
*
*
*
*
*
*
*
*
*
*
S
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*