Completed

Create, compile and test Java function to translate String letter by letter

I need you to create a function in Java translate_string(),

which is doing "translation" of the string letter by letter.

Function takes String as arg, and returns array of String[]:

public static String[] translate_string(String string)

Given existing function translate_letter(),

which takes String as arg and returns array of String[]

public static String[] translate_letter(String letter)

and it translating each letter, you need to sequentially translate

the whole string letter by letter into combination of output strings.

Complexity is, that one character could be translated to multiple

sets of characters, it is not one-to-one relationship between

input string and output string, it is - one-to-many relationship,

where one letter as input could produce multiple combinations

(i.e. arrays) as output.

N.B.: Term translation has nothing to do with actual translation from

one language to another, it is just substitution of one character

to set of other characters.

Below is exact code id simplified version of function

translate_letter() (no modification is required):

//------------------------------------------------------------

// translate letters - return array of diff combinations

public static String[] translate_letter(String s) {

ArrayList<String> o = new ArrayList<>(1);

if ( [login to view URL]("a") ) { // if a

[login to view URL]("a1");

} else {

if ( [login to view URL]("b") ) { // if b

[login to view URL]("b1"); [login to view URL]("b2");

} else {

if ( [login to view URL]("c") ) { // if c

[login to view URL]("c1"); [login to view URL]("c2"); [login to view URL]("c3");

} else {

if ( [login to view URL]("d") ) { // if d

[login to view URL]("d1"); [login to view URL]("d2"); [login to view URL]("d3"); [login to view URL]("d4");

} else {

[login to view URL](s); // s = def add (if nothing above matches)

} // end if d

} // end if c

} // end if b

} // end if a

//Convert ArrayList o to string array[]

String[] array = [login to view URL](new String[[login to view URL]()]);

return array;

} // end translate_letter()

//------------------------------------------------------------

So, how to translate?

Let's have a look at simple version of translate - when

translate_letter() return just string.

So, letter "a" will be translated to "a1", letter "b"

will be translated to "b1", "c" - to "c1".

Input string "a" will be translated as "a1", simple.

Input string "ab" will be translated as "a1b1", simple.

Input string "abc" will be translated as "a1b1c1", simple.

I don't need to create this simple version - it is nothing to do here.

What I need you to write - is complicated version of translate_string(),

when function translate_letter() returns multiple combinations,

i.e. - array of output combinations.

For example (according to the code of translate_letter() above,

letter "a" will be translated to "a1", simple.

But letter "b" will be translated by translate_letter() to 2 combinations:

"b1" and "b2",

and output is String[] array = {"b1", "b2" }

So, string "a" will be translated by translate_string() as array of

just 1 element R[] = { "a1" }

String "ab" will be translated as array of 2 elements

R[] = { "a1b1", "a1b2" }

String "abc" will be translated as:

R[] = { "a1b1c1", "a1b1c2", "a1b1c3", "a1b2c1", "a1b2c2", "a1b2c3" }

String "db" will be translated as:

R[] = { "d1b1", "d2b1", "d3b1", "d4b1" }

Note, that actual sequence of individual

You can use any data structure, supported by Java 11 and below -

Array, 2-dimensional array, ArrayList, Vector, Hash, Map, Tree, Trie, etc,

as soon as it is doing the correct translation.

Preferable - use ArrayList as data structure, but it could be any,

but code needs to be documented to explain what all major steps are doing.

Skills: Java

See more: create gadget using java, create online test, create asterisk design java script, convert char to string java, string length java, char[] to string java, how to convert char array to string in java, charat (java), char to int java, int to string java, java string, science writer needed create practice test, java code translate morse english, create selenium test, translate cuban letter english, want translate english letter french letter, create gallery using java, create ordering system java, create log file java script, compile red5 java application

About the Employer:
( 6 reviews ) Glenfield, Australia

Project ID: #24492821

Awarded to:

raviss20

I can do this.

$50 AUD in 1 day
(6 Reviews)
3.2

21 freelancers are bidding on average $32 for this job

koustav2006

HI..I am proficient in core Java OO programming and can clearly understood the algorithm behind the implementation of translate_string(String s) using given translator_letter() as per posted explanations and can help y More

$70 AUD in 1 day
(214 Reviews)
6.5
paulprabhakarand

Hi Gentleman, This is Paul Devanesan has done [login to view URL] and [login to view URL] from IIT Madras. I am a technology expert, more than a decade I am developing and delivering applications on Java based technologies. I am a certified Ja More

$40 AUD in 1 day
(53 Reviews)
6.1
namitkhandelwal

Hello, warm greetings! I am a Java developer working on Java technology since 7+ years having hands on windows and web development experience. I would like to help in your application development. It would be better More

$40 AUD in 7 days
(49 Reviews)
5.1
Hada36

Hello, Thank you very much post your project. I am very much interested on your [login to view URL] my Experience and Expertise I believe and very confident that I will be able to handle your project efficiently and effect More

$30 AUD in 1 day
(24 Reviews)
4.4
Absar631

I checked your project carefully. I have a great interest in your project. I have lots of experience in your project. I'm sure of completing your project in the shortest time with a high quality. If you hire me, then y More

$10 AUD in 1 day
(21 Reviews)
4.1
Ahmed818

Hello, ⭐⭐⭐⭐⭐ i am interested in this project , can begin now waiting your answer on chat Regards ⭐⭐⭐⭐⭐

$30 AUD in 1 day
(11 Reviews)
3.8
mfaisal902

Greetings Sir, I am Muhammad Faisal and i am a professional Java Developer having almost 5 years of experience and we provide you quality work within your budget and time duration so, lets get started ? Thanks

$20 AUD in 7 days
(16 Reviews)
3.5
rinabuoy13

Hello, I am an independent, experienced java expert. I can help with this task with a quick turn-around. Looking to hearing from you. Kind regards Rina B.

$30 AUD in 1 day
(8 Reviews)
3.4
soiganraducu

I can do this project for you. Let's discuss more details in private. Looking forward to working with you!

$30 AUD in 4 days
(11 Reviews)
3.5
rollyarnaudo

Do you need the resulting strings in any order? Is there any worst-case running time constraint? I can do it straight away. It will take me just a few hours. If you do have some examples (to use for unit tests), that w More

$20 AUD in 7 days
(4 Reviews)
2.3
arupmishra

Can be done in a day

$25 AUD in 1 day
(3 Reviews)
2.4
CodingHelpLine

Hello Sir/Madam I'm Sun Certified Java Programmer. I have development experience in Java Technologies, OOP, Data Structures, Database Driven applications, APIs, Files and Data Transformation, ETL and various framewor More

$25 AUD in 1 day
(3 Reviews)
2.0
liuliu123

Hi In fact, I think I am quite suitable for the compilation of this demo. I can write reasonable functions using Java, and I can do a very good job in code specification and comments. In terms of data structure design, More

$15 AUD in 7 days
(0 Reviews)
0.0
taxmanthefirst

Hey! I can have it done quickly, to be honest it looks like an University assignment. Hope the price is OK for you, thanks in advance :)

$20 AUD in 1 day
(0 Reviews)
0.0
Surendra2468

I am having 7. 5 years of experience on java development. I can help you on this requirement. Thank You

$30 AUD in 7 days
(0 Reviews)
0.0
$25 AUD in 1 day
(0 Reviews)
0.0
omobowale

I have sufficient experience and am an expert in writing Java codes that solve problems. I am versed and versatile in using ArrayLists to solve logical problems like this. Give me a chance to prove myself.

$25 AUD in 4 days
(0 Reviews)
0.0
Mohanreddy070

It a a hobby for me to solve these type of programming tasks. This is my first task as a freelancer. please go through my hacker rank profile [login to view URL] The code I present to you will have clear comm More

$25 AUD in 7 days
(0 Reviews)
0.0
samahwasalim

I have three experience on android development and I worked in complicated system in Java languages. I can do your project. you can contact me to discuss the project requirements.

$20 AUD in 7 days
(0 Reviews)
0.0
CooderGuy

hi.... having expertise in Java with 5+ years of experience, I assure you to complete your project within 2 days time. ping me to discuss further

$83 AUD in 2 days
(0 Reviews)
0.0