EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
Expert Solution & Answer
Book Icon
Chapter 3, Problem 10RQ
Program Description Answer

The legally coded return statement for the method with the declaration “public static int getVal(double sum)” is “return 77”.

Hence, the correct answer is option “B”.

Blurred answer
Students have asked these similar questions
a) Write a boolean method called sumDivisibleByFive that returns true if the sum of the digits of its integer parameter is divisible by 5 and false otherwise. For example, if the parameter passed to the method is 73 then the sum of its digits is 10 (7+3) The method should return true since 10 is divisible by 5. b) Write a main method that calls the method sumDivisibleByFive for the values between 10 and 100 inclusive 10 per line. This should output the following numbers: 14 19 23 28 32 3741 46 50 55 64 69 73 78 82 87 91 96
a) Write a boolean method called sumDivisibleByFive that returns true if the sum of the digits of its integer parameter is divisible by 5 and false otherwise. For example, if the parameter passed to the method is 73 then the sum of its digits is 10 (7+3). The method should return true since 10 is divisible by 5. b) Write a main method that calls the method sumDivisibleByFive for the values between 10 and 100 inclusive 10 per line. This should output the following numbers: 14 19 23 28 32 37 41 46 50 55 Using java 64 69 73 78 82 87 91 96
a) Write a boolean method called productDivisibleByThree that returns true if the product of the digits of its integer parameter is divisible by 3 and false otherwise. For example, if the value passed to the method is 23 then the product of its digits is 6 (2*3). The method should retum true since 6 is divisible by 3. b) Write a main method that calls the method productDivisibleByThree for the values between 10 and 50 inclusive 10 per line. This should output the following numbers: 10 13 16 19 20 23 26 29 30 31 Using java 32 33 34 35 36 37 38 39 40 43 46 49 50
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,