Question: Problem 3 (10 pts) The function level(a,b,c,d) is a function that divides the largest of its integer arguments by 2. If more than one argument

Problem 3 (10 pts)

The function level(a,b,c,d) is a function that divides the largest of its integer arguments by 2. If more than one argument are equal and are the largest, they are divided by 2.

For example given a=1,b=2,c=4,d=8, level(a,b,c,d) changes d to 4.

A second call level(a,b,c,d) would change both c and d to 2.

a) Write the code of the function level. (4 pts)

b) To test it, write a program that initializes a = 100; b = 200; c = 400; d = 800; then calls level(a,b,c,d) 10 times in a forloop. In each call, display the new values of a, b, c, and d. (6 pts)

Solve using JAVA eclipse program please

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!