Java Programming (MindTap Course List)
9th Edition
ISBN: 9781337397070
Author: Joyce Farrell
Publisher: Cengage Learning
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
1. Write the following method that returns the intersecting point between two lines (p1, p2) and (p3, p4):
public static Point2D getIntersecting Point (
Point 2D pl, Point2D p2, Point 2D p3, Point2D p4);
The method returns null if the two lines are parallel. Write a test program that prompts the user to enter
three points and displays the center point. Here is a sample run. (Hint: for finding the intersecting point
between two lines, see Programming Exercise 8.31.)
Enter x1, yl, x2, y2, x3, y3, x4, y4: 2 2 5 -1.0 4.0 2.0 -1.0 -2.0
The intersecting point is at (2.88889, 1.1111)
Enter x1, yl, x2, y2, x3, y3, x4, y4: 2 2 7 6.0 4.0 2.0 -1.0 -2.0
The two lines are parallel
1. Write the following method that returns the intersecting point between two lines (p1, p2) and (p3, p4):
public static Point 2D getIntersecting Point (
Point 2D pl, Point 2D p2, Point 2D p3, Point2D p4);
The method returns null if the two lines are parallel. Write a test program that prompts the user to enter
three points and displays the center point. Here is a sample run. (Hint: for finding the intersecting point
between two lines, see Programming Exercise 8.31.)
Enter x1, yl, x2, y2, x3, y3, x4, y4: 225 -1.0 4.0 2.0 -1.0 -2.0
The intersecting point is at (2.88889, 1.1111)
The two lines are parallel
Examine the method header below, then write a call to the method as an example.a personal void ShowValue()
Chapter 3 Solutions
Java Programming (MindTap Course List)
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
- 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.4arrow_forwardWrite a method with the following header to display threenumbers in decreasing order:public static void displaySortedNumbers(double num1, double num2, double num3)Write a test program that prompts the user to enter three numbers and invokes themethod to display them in decreasing order.arrow_forwardJAVA PROGRAM SEE ATTACHED PHOTO FOR THE PROBLEMarrow_forward
- Examine 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_forwardLook through the method header below, then, as an example, write a call to the method. an internal void ShowValue()arrow_forward
- Create a method where a goblin will attack a zombie as long as the zombie has no health, otherwise the zombie is already dead. If the zombie has 0 or less health, the attack method should add 10 health to the zombie, bringing them closer to being alive so that they will be dead it should then return the zombies health. If the health of the zombie is positive the attack method should return "Zombie is alive, therefore it is not a zombie!". NOTE: This problem statement is extremely vague. This is to test how well you follow directions.arrow_forwardFind the error in the following method definition:Look at the following method header:public static void showValue(int x)The following code has a call to the showValue method. Find the error.int x = 8;showValue(int x); // Error!arrow_forwardCreate a method "public void giveRaise(int percentage)" in the Employee class. This method should increase the salary member by the percentage specified in the parameter. In the main method: 1. Create an Employee object. Print out its toString() result. Call giveRaise with 10%. 2. Print out its toString() result.arrow_forward
- Objective: Write a class that will test dates and times inputted by the user and determine whether or not it is valid. This will focus on the usages of methods to organize code. First download the driver and put it in your project DO NOT ALTER THE DRIVER! Use this to run your project The driver : public class DateAndTimeDriver { public static void main(String[] args) { // TODO Auto-generated method stub DateAndTimeTester dtTester = new DateAndTimeTester(); dtTester.run(); } } Write a class file called DateAndTimeTester This DOES NOT have a main method Create the following methods run: This method returns nothing and takes no parameters. This is called by the driver and should handle all of the input from the Scanner and dialog for the user. isValid: returns true or false if a given String has the correct date and time. The String parameter should be formatted “MM/DD hh:mm” This method should call the methods isValidDate and isValidTime to determine this. isValidDate: returns…arrow_forwardJAVA PROGRAM SEE ATTACHED PHOTO FOR THE PROBLEMarrow_forward11arrow_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