Question: BASIC JAVA Q1 Parts 1 - 4 1. Write a method that, given two sorted arrays of integers, merges the two arrays into a single

BASIC JAVA Q1 Parts 1 - 4

BASIC JAVA Q1 Parts 1 - 4 1. Write a method that,

1. Write a method that, given two sorted arrays of integers, merges the two arrays into a single sorted array that is returned 2. Write a method that returns true if the list is already sorted in increasing order and false if it is not sorted. Use the following method declaration public static boolean isSorted (int[] list) 3. Write a method that given a list of floating point numbers determines if a particular value is in the list. Your method should return the location of the item if it is found, or -1 if it is not found. Use the searching algorithm of your choice. Here is the method declaration you should use: public static int find (double [] list, double key) 4. What is wrong with the following program or code fragments? How would you correct the errors? (a) Assume the Circle class has a no-arg constructor and a getRadius() method public class ShowErrors f public void method1 () t Circle c; System.out.println ("Radius is " + c.getRadius )); cnew Circle ); public class ShowErrors i public static void main (String [1 args) I C c- new C(5.0); System.out.println (c.value); class CI int value 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!