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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started