Question
I need to write a JAVA code , please HELP! I am posting the starter code, help me please to fill out the TO DO
I need to write a JAVA code , please HELP!
I am posting the starter code, help me please to fill out the TO DO parts
also I am posting the result I need to create
thanks
HERE IS THE STARTER CODE (TWO PARTS)
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random;
public class InterviewQuestionsTest {
private static Random r; static { r=new Random(2); } public static int [] GetRandomArray(int n, int min, int max) { int []a=new int[n]; for(int i=0; i
}
THIS IS THE SECOND PART AND HERE IS WHERE MY CODE NEED GO
import java.util.ArrayList;
public class InterviewQuestions {
public int findPriceyNeighbours(double[] prices)
{
//TO DO
return -1;
}
public ArrayList
{
ArrayList
//ToDo
return common;
}
public int countDivisors(int[] values)
{
//ToDo
return -1;
}
public int findIndexOfFirstOddNumber(int[] numbers)
{
//ToDo
return -1;
}
}
This is the result that should come out
/*If you have implemented your GLA correctly, the following will be your program's output:
Problem One: Pricey Neighbours
House Prices:
622968.00
520112.00
840169.00
925050.00
916256.00
909680.00
650372.00
979577.00
656166.00
891104.00
First index of Pricey Neighbours is: 3
Problem Two: Common Friends
David's Friend List: Jacob, Benjamin, Joseph, Owen, Michael, Lucas, Wyatt, Owen, Jacob, Alexander,
Susan's Friend List: Jack, Alexander, Samuel, Henry, Daniel, Logan, Joseph, Benjamin, Sebastian, Wyatt,
Common Friends's Friend List: Benjamin, Joseph, Wyatt, Alexander,
Problem Three: Count Divisors
10 13 20 15 13 10
Count: 3
Problem Four: First Odd Number
16 20 40 12 35 19 23 31 35 11
First odd number's index is: 4
*/
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