Find Jobs
Hire Freelancers

Creation of a basic Java program

$10-30 USD

Completed
Posted about 1 year ago

$10-30 USD

Paid on delivery
write a Java program called [login to view URL] that reads in two lines of input from the standard input. The first line contains a single positive integer (n), and the second line contains (n) positive integers separated by spaces. The program should determine if the second input line contains an integer that is the sum of some subset (one or more) of the integers appearing earlier in the line. If so, your program should print out "true"; otherwise it should print out "false" . Preference will be given to bids under $20 since it’s a relatively easy assignment. Attached is a screenshot of the assignment. At the bottom here are two sample codes as a blueprint (but they give an error when you run them separately). First nonworking code: import java.util.*; public class SumOfSubsetPrevious { public static void main(String[] args) { //Storing the input Scanner scannings = new Scanner([login to view URL]); int lengthening = [login to view URL](); int[] numericals = new int[lengthening]; for(int i = 0; i < lengthening; i++) { numericals[i] = [login to view URL](); } //Calculating the running tally for each boolean Verification = false; int Summation; for( int j = 0; j < lengthening; j++) { //elements zero 9 10 9 11 7 13 8 9 6 9 Summation = 0; int[] momentary = new int[j+1]; for(int k = 0; k < j; k++) { momentary[k] = numericals[k]; } ArrayList<Integer> A = new ArrayList<>([login to view URL](momentary)); Combination(A, numericals[j]); } // Function call } static void unique_combination(int l, int sum, int K, ArrayList<Integer> local, ArrayList<Integer> A) { // If a unique combination is found if (sum == K) { [login to view URL]("{"); for (int i = 0; i < [login to view URL](); i++) { if (i != 0) [login to view URL](" "); [login to view URL]([login to view URL](i)); if (i != [login to view URL]() - 1) [login to view URL](", "); } [login to view URL]("}"); return; } // For all other combinations for (int i = l; i < [login to view URL](); i++) { // Check if the sum exceeds K if (sum + [login to view URL](i) > K) continue; // Check if it is repeated or not if (i > l && [login to view URL](i) == [login to view URL](i - 1) ) continue; // Take the element into the combination [login to view URL]([login to view URL](i)); // Recursive call unique_combination(i + 1, sum + [login to view URL](i), K, local, A); // Remove element from the combination [login to view URL]([login to view URL]() - 1); } } // Function to find all combination // of the given elements static void Combination(ArrayList<Integer> A, int K) { // Sort the given elements [login to view URL](A); // To store combination Vector<Integer> local = new ArrayList<Integer>(); unique_combination(0, 0, K, local, A); } } Second Nonworking code: import [login to view URL]; public class SumOfSubsetPrevious { public static void main(String[] args) { Scanner sc = new Scanner([login to view URL]); int n = [login to view URL](); int[] nums = new int[n]; for (int i = 0; i < n; i++) { nums[i] = [login to view URL](); } boolean found = false; for (int i = 1; i < n; i++) { for (int j = 0; j < i; j++) { if (nums[i] == nums[j]) { found = true; break; } for (int k = j; k < i; k++) { if (nums[i] == nums[j] + nums[k]) { found = true; break; } } } } [login to view URL](found ? "true" : "false"); } }
Project ID: 35906326

About the project

8 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 I have 10 years of strong experience in Java , Flutter , Android , IOS , Angular, React ,JavaScript, CSS, HTML5, HTML, Node.js, as a result, we can successfully complete this project. [login to view URL] Here detailed information about our company Also, we wanted to personally discuss questions about your project, which helps us to give you the right estimation. Best regards, Govind Singh.
$20 USD in 1 day
5.0 (6 reviews)
2.8
2.8
8 freelancers are bidding on average $32 USD for this job
User Avatar
Hi, I am a professional programmer and trader and will give you the best work I have innovative tech mind with 10 years of experience working as a computer programmer. Capable of working with a variety of technology and software solutions and managing databases. The valuable team member who has experience diagnosing problems and developing solutions. Extensive expertise in networking systems and working with mainframe computers. A talented leader with unique ideas and a history of successful contributions in the field. -Solid background and advanced knowledge in computer development software including C++, Java, PHP, Java script,Python, R, Spark, Visual Basic, and Maven. -Skilled in working with database management tools such as MySQL, Hadoop, Sybase, and MongoDB. -Highly organized with an exceptional commitment to task completion and quality assurance when working with computer software programs. -Committed to delivering company objectives to projects and results to customers and improving each version of the software I engage with. -Ability to solve complex problems successfully with minimal guidance or help using a logical reasoning technique and strong attention to detail. Inbox me for more details. Thanks
$50 USD in 1 day
4.9 (4 reviews)
3.3
3.3
User Avatar
Hi There, Greetings! I hope you are doing well..... I am very excited to start work on this project. I have done Masters in Computer Applications that is why I can understand your need very well. I have OCJP certification and enjoy experience in Android app development as well. I will provide you quality work but if you need any changes in that, I will do so without any extra fee. I hope we will meet over chat to discuss more about this project. Thanks
$20 USD in 1 day
4.5 (8 reviews)
3.2
3.2
User Avatar
As a Java Developer I am having total of 2.3 Years of experience with using Core Java,Spring Boot, Hibernate,Webservices,Github.
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi, I read the details and also seen the screenshot you provided, I can give you very effective solution of your problem. I also studied CS in my college and I can solve this, you can award this to me asap.
$15 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I'm very excited to know about the challenge and I'm here to help you out. I know this is my first project on this platform but if you into my industry experience had worked on lot of this kind of problem and completed successfully. I'm looking forward to get positive response from you.
$20 USD in 7 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
South Ozone Park, United States
5.0
17
Payment method verified
Member since Apr 12, 2019

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.