EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Chapter 3, Problem 7RQ
Program Description Answer
The correct method call for the declared method public static void showResults(double d, int i) is “showResults(12.2, 67)”.
Hence, the correct answer is option “B”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Examine the method header below, then write a call to the method as an example.a personal void ShowValue()
Consider the following methods:
public void inchesToCentimeters(double i)
{
double c = i * 2.54;
printInCentimeters(i, c);
}
public void printInCentimeters(double inches, double centimeters)
{
System.out.print(inches + "-->" + centimeters);
}
Assume that the method call inchesToCentimeters(10) appears in a method in the same class. What
is printed as a result of the method call?
inches -> centimeters
10 -> 25
25.4 -> 10
10 -> 12.54
10.0 -> 25.4
JAVA PROGRAM
SEE ATTACHED PHOTO FOR THE PROBLEM
Chapter 3 Solutions
EBK JAVA PROGRAMMING
Ch. 3 - Prob. 1RQCh. 3 - Prob. 2RQCh. 3 - Prob. 3RQCh. 3 - Prob. 4RQCh. 3 - Prob. 5RQCh. 3 - Prob. 6RQCh. 3 - Prob. 7RQCh. 3 - Prob. 8RQCh. 3 - Prob. 9RQCh. 3 - Prob. 10RQ
Ch. 3 - Prob. 11RQCh. 3 - Prob. 12RQCh. 3 - Prob. 13RQCh. 3 - Prob. 14RQCh. 3 - Prob. 15RQCh. 3 - Prob. 16RQCh. 3 - Prob. 17RQCh. 3 - Prob. 18RQCh. 3 - Prob. 19RQCh. 3 - Prob. 20RQCh. 3 - Prob. 1PECh. 3 - Prob. 2PECh. 3 - Prob. 3PECh. 3 - Prob. 4PECh. 3 - Prob. 5PECh. 3 - Prob. 6PECh. 3 - Prob. 7PECh. 3 - Prob. 8PECh. 3 - Prob. 9PECh. 3 - Prob. 10PECh. 3 - Prob. 11PECh. 3 - Prob. 12PECh. 3 - Prob. 13PECh. 3 - Prob. 1GZCh. 3 - Prob. 2GZCh. 3 - Prob. 1CP
Knowledge Booster
Similar questions
- Look at the header of the method below, and then implement a sample call to it in your code.private static void ShowValue ()arrow_forwardExamine the method header below, and then write a call to it as an example.void private ShowValue()arrow_forwardGiven the code below, write a method call for the method (assume that each parameter is a String). Then determine that method’s output given the arguments that you pass. METHOD trickOrTreat (parameters: candy) BEGIN CREATE treat ← 26 SWITCH candy CASE “Tootsie Roll”: treat ++ CASE “Candy Corn”: treat += 2 BREAK CASE “Twizzlers”: treat -= 2 CASE “Dots”: treat -- CASE “Kit Kat”: treat *= 2 END SWITCH RETURN treat END METHOD Method Call Exact Outputarrow_forward
- What type of information does the following method return? public static void methodRankPoints(double points) int double nothing object Which statement is correct? The while loop repeats a set of code while a condition is not met. The number of iterations required of a while loop is always known before the while loop begins. The while loop repeats a set of code while a condition is met. The while loop does not require code to be added to manage iteration during each loop. Which of the following statements is true with regard to java exceptions? A try block can be followed by multiple catch blocks. A program automatically terminates immediately after a catch block is executed. Only one try/catch block is allowed in a single method. A try-catch is required in all methods.arrow_forwardJAVA PROGRAM SEE ATTACHED PHOTO FOR THE PROBLEMarrow_forward11arrow_forward
- QUESTION 14 Multiple Choice: Which of the statements is FALSE regarding the code below ? public static int method({ int x = 10; if( x < 50 ){ int y = 0; O the scope of y is the method body of method() O method is the identifier O public, static are modifiers O y is in the scope of x QUESTION 15 True or False: Method abstraction is the concept of breaking a large program into smaller methods. O True Falsearrow_forwardIf the value passed into the parameter x in the following method is 30. What is the value returned by this method? public static int method1(int x) { int y = 4*x -5; return y; }arrow_forwardThis is the first exercise for the TODO comments in the main method. Complete the actions described in these comment lines in the main method:// TODO: Add a public static constant called PRIMARY_NAME// to the Student class. Set the name of the Primary to// a real University. In other words: Add a public static final String variable called PRIMARY_NAME to the fields of the Student class. Initialise the variable in the same line it is declared (not in the constructor) to the name of a real Primary. Add code to the Main class in this project to access the PRIMARY_NAME field and print it out. Remember that, because the field is public, it can be accessed directly from another class without having to provide a getter method for it. In the lecture discussing static fields and methods, we showed that the nextID field in the Student class is used to store the value of the next…arrow_forward
- use only C# programming Write a method call CubeIt(int x, ref int cube) that takes two arguments and does not return a value. The method will cube the first argument and assign it to the second argument.In your main, call this method twice and print the value of the parameters after each method call. Write a method with the following header: static void CalculateTuitionFee(int numberOfCourses, double costPerCourse, ref double fees). This method will calculate and assign the required fees amount to the third argument. [Fees = number of courses * cost per course + 15.25].From your program Main() method, call the CalculateTuitionFee () method four times supplying different arguments each time and display the value of the third argument after each method call. Write a method that takes four parameter of type int. The method will assign the sum of the first two arguments to the third and the difference of the first two to the fourth. This method should be coded so that the calling…arrow_forward1. Which of the following would be a valid method call for the following method? public void showProduct(int position, double cost) { System.out.println("Product in position "+position+" costs "+cost); } A. showProduct(5.5, 4.0); B. showProduct(10.0, 4); C. showProduct(10, 4.5); D. showProduct(33.0, 55.0);arrow_forwardFor each call to the following method, indicate what value is returned: public int mystery4(int x, int y) { if (x < y) { return x; } else { return mystery4(x - y, y); } } mystery4(6, 13) mystery4(14, 10) mystery4(37, 10) mystery4(8, 2) mystery4(50, 7)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT