Find Jobs
Hire Freelancers

Programming Java: Solution to three water jug problem infinite loop error -- 2

$10-30 USD

Completed
Posted about 1 year ago

$10-30 USD

Paid on delivery
I am trying to write code that solves similar to this: [login to view URL]) , except the problem uses three water jugs. You start with one of the jugs being full and the others being empty, then choose two out of the three jugs and pour the contents of one of these into the other one until either one is empty or the second is full, and this can be repeated multiple times until the the desired amount of water in a jug is achieved. cap[] is an integer array of the capacities of the containers and d is the desired number to be obtained, both entered by input. If no solution can be obtained then no output should be produced. The following input: 20 5 3 4 should produce the following output: 20 0 0 15 5 0 15 2 3 18 2 0 18 0 2 13 5 2 13 4 3 Where 20 5 3 are capacities of the three containers and 4 is the desired number to be reached ie the variable d. The code requires using no more advanced data structures than arraylists, linkedlists, stacks, and queues. I have already have code for this program however it appears to get stuck in an infinite loop when given the following input to test it out: 81 52 43 21 My request is to have the code fixed so it can work with the prior input to not do infinite loop. The code is linked.
Project ID: 36074939

About the project

5 proposals
Remote project
Active 1 yr 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
Hello, This is java expert. Your issues is a piece of cake for me. . Let's contact right now. Regards
$20 USD in 1 day
4.9 (20 reviews)
6.2
6.2
5 freelancers are bidding on average $24 USD for this job
User Avatar
✅ Full Experiences and Profound Knowledge in ⭐Java Programming⭐✅. Hi, how are you? I am very confident to complete your project perfectly. I can start your work right now. Of course, since I am new here, then my job history and feedback score on freelancer is not sufficient, but you don’t need to worry! I can guarantee the quality of the job and deliver the result on time. I hope we will discuss in more detail via chat. Best regards! https://www.freelancer.com/u/KawlCarter
$20 USD in 1 day
5.0 (5 reviews)
2.8
2.8
User Avatar
Hello. I read your requirement i will do that. Please come on chat we will discuss more about this. I will waiting your reply.
$30 USD in 1 day
5.0 (2 reviews)
1.9
1.9
User Avatar
Hi I'm skilled software engineer, and I'm hard worker, I've seen your job description about (( Solution to three water jug problem infinite loop error )) and i'm ready to help you skillfully. Hope to hear from you soon. Best regards, Said.
$30 USD in 1 day
5.0 (1 review)
1.0
1.0
User Avatar
GOOD IN JAVASCRIPT, MYSQL, PYTHON, C PROGRAMMING AND HTML HELLO DEAR CLIENT Thank you for sharing your project requirement, I have carefully read the project description and I would like to take part in this project. I will work according to your requirement to provide the best quality and customer satisfaction. I hope you will benefit from my services I can assurance that I will live up to your expectation
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Succasunna, United States
0.0
0
Payment method verified
Member since Feb 26, 2023

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.