Question: complete for thumbs up :) java. Question 4. (12pts, 4 each) DO ONLY 3 OUT OF THE 4 PARTS OF THIS QUESTION. (MARK YOUR CHOICES
Question 4. (12pts, 4 each) DO ONLY 3 OUT OF THE 4 PARTS OF THIS QUESTION. (MARK YOUR CHOICES CLEARLY AS ONLY 3 WILL BE GRADED.) a. An integer is a "Lucky Number" if it is divisible by 7 or is divisible by 11 and it is in the range 1000 through 4000. Write a Boolean expression that is true if and only if myNum (an int variable) contains a Lucky Number. b. Let a and represent the length and the width of a rectangle. The length of the diagonal of the rectangle can be calculated by the following mathematical expression. Jaz+b= If len and wid are double variables holding the values of the length and width of some rectangle, write an expression in Java for the length of the diagonal of that rectangle. C. Write a Java method named ran that receives no arguments and returns a random integer between 0 and 5. d. Suppose I am doing a binary search on the following array for the number 117: int nums[] = {1, 77, 78, 89, 100, 125, 235, 390, 1000}; List the numbers that are checked by the search before it reports that 117 is NOT found in the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
