Question: In a certain code language, numerals are each represented by a symbol or a letter. They are as follows Numeral 0 1 2 3 4

In a certain code language, numerals are each represented by a symbol or a letter. They are as follows

Numeral

0

1

2

3

4

5

6

7

8

9

Symbol code

*

B

E

A

@

F

K

%

R

M

Numerals are to be coded as per the codes in the table and the following conditions:

a. If the first and the last digits are odd, both are to be coded as X.

b. If the first and the last digits are even, both are to be coded as $.

c. If the last digit is 0, it is to be coded as #.

For example, 487692 is coded as $R%KM$

Write a program that takes as input a sequence of numbers and displays the corresponding code to represent it.

(Java)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!