Question: Question 1 Write a function that accepts two integer values as parameters and returns the larger integer value. Question 2 Write a function that accepts

Question 1
Write a function that accepts two integer values as parameters and returns the larger integer
value.
Question 2
Write a function that accepts two integer arrays of the same size. The function should create
a new array that can store the values in both arrays. To combine (or merge) these two arrays,
compare the elements one by one in each array and write the smaller value and then the larger
value to the new array. The function should return the new array.
For example, for two arrays {2,10,3} and {1,3,5}, you should compare the first element
of each, 2 and 1, and place 1, then 2 into the larger array. The final larger array should be {1,
2,3,10,3,5}
Question 3
Write a program that takes two arguments: your name and the number of times to print it on
the screen.
Question 4
Write a program that takes a number of arguments. For each argument, find the number of
the character a appears. The program should print the number of as in all arguments.
Question 5
Write the following recursive function using a loop.
public class Recursion {
public static void main(String[] args){
int m = recurse(10);
System.out.println(m);
}
public static int recurse(int a){
if(a ==1) return 1;
return a + recurse(a -1);
}
}
write these in java

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!