Find Jobs
Hire Freelancers

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

$10-30 AUD

Completed
Posted about 4 years ago

$10-30 AUD

Paid on delivery
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.
Project ID: 24492821

About the project

20 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I can do this.
$50 AUD in 1 day
5.0 (6 reviews)
3.2
3.2
20 freelancers are bidding on average $32 AUD for this job
User Avatar
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 you write the function and its sample usage in a program.
$70 AUD in 1 day
4.9 (218 reviews)
6.6
6.6
User Avatar
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 if you can share more details about it if you are interested. Please message me to discuss more about the requirements. looking for your positive response. Thanks Namit
$40 AUD in 7 days
4.9 (59 reviews)
5.4
5.4
User Avatar
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
5.0 (9 reviews)
3.7
3.7
User Avatar
Hello, ⭐⭐⭐⭐⭐ i am interested in this project , can begin now waiting your answer on chat Regards ⭐⭐⭐⭐⭐
$30 AUD in 1 day
5.0 (11 reviews)
3.8
3.8
User Avatar
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
5.0 (16 reviews)
3.7
3.7
User Avatar
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 your project will be completed more successfully
$10 AUD in 1 day
4.8 (21 reviews)
4.1
4.1
User Avatar
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
4.9 (17 reviews)
3.5
3.5
User Avatar
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 would be great.
$20 AUD in 7 days
5.0 (7 reviews)
3.6
3.6
User Avatar
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 frameworks. I can help implement awesome Java desktop (Console, Swing, JavaFX), Web (JEE, Spring) and Android (Java, Kotlin) application. Contact me with details to get started. I assure you an excellent solution of your project within the time frame and exactly according to the requirements. Thanks @CodingHelpLine
$25 AUD in 1 day
5.0 (15 reviews)
3.0
3.0
User Avatar
Can be done in a day
$25 AUD in 1 day
5.0 (3 reviews)
2.4
2.4
User Avatar
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.0 (0 reviews)
0.0
0.0
User Avatar
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, I think I can also efficiently implement this function.
$15 AUD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
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.0 (0 reviews)
0.0
0.0
User Avatar
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.0 (0 reviews)
0.0
0.0
User Avatar
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.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRALIA
Glenfield, Australia
5.0
6
Payment method verified
Member since Oct 31, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.