Big Java Late Objects
Big Java Late Objects
2nd Edition
ISBN: 9781119330455
Author: Horstmann
Publisher: WILEY
bartleby

Videos

Textbook Question
Book Icon
Chapter 5, Problem 32PP

Electric wire, like that in the photo, is a cylindrical conductor covered by an insulating material. The resistance of a piece of wire is given by the formula

R = ρ L A = 4 ρ L π d 2

where ρ is the resistivity of the conductor, and L, A, and d are the length, crosssectional area, and diameter of the wire. The resistivity of copper is 1.678 × 10−8 Ω m.

The wire diameter, d, is commonly specified by the American wire gauge (AWG), which is an integer, n. The diameter of an AWG n wire is given by the formula

d = 0.127 × 92 36 n 39 m m

Write a method

public static double diameter(int wireGauge)

that accepts the wire gauge and returns the corresponding wire diameter. Write another method

public static double copperWireResistance(double length, int wireGauge)

that accepts the length and gauge of a piece of copper wire and returns the resistance of that wire. The resistivity of aluminum is 2.82 × 10−8 Ω m. Write a third method

public static double aluminumWireResistance(double length, int wireGauge)

that accepts the length and gauge of a piece of aluminum wire and returns the resistance of that wire.

Write a program to test these methods.

Blurred answer
Students have asked these similar questions
vvvHarry has a big wall clock, that got hit while he was playing. Now, the minute hand doesn't rotate by the angle 2π/3600 each second, but now it moves according to different angle x. You can assume that coordinates of the centre of the clock are (0, 0) and the length of the minute hand is l. One endpoint of the minute hand is always located at the clock centre; the other endpoint is initially located at the point (0, l). One second later, Harry observes that this endpoint is at distance d above the x-axis, i.e., the y-coordinate of this endpoint is equal to d. Harry is curious about where the minute hand will be (specifically, its y-coordinate) after t seconds. Because t can be very large, Harry can't wait for that moment. Please help him to write a python code that prints a single line containing the output.Input: 4 2 2Output4Harry has a big wall clock, that got hit while he was playing. Now, the minute hand doesn't rotate by the angle 2π/3600 each second, but now it moves according…
The equation of a line in standard form is ax + by = c , wherein both aand b cannot be zero, and a, b, and c are real numbers. If b≠0, then –a/b is the slope of the line. If a = 0, then it is a horizontal line, and if b = 0, then it is a vertical line. The slope of a vertical line is undefined. Two lines are parallel if they have the same slope or both are vertical lines. Two lines are perpendicular if either one of the lines is horizontal and the other is vertical or the product of their slopes is –1. Design the class lineType to store a line. To store a line, you need to store the values of a (coefficient of x), b (coefficient of y), and c. Your class must contain the following operations: If a line is nonvertical, then determine its slope. Determine if two lines are equal. (Two lines a₁x + b₁y = c₁ and a₂x + b₂y = c₂ are equal if either a₁ = a₂, b₁ = b₂, and c₁ = c₂, or a₁ = ka₂, b₁ = kb₂ and c₁ = kc₂, and for some real number k.) Determine if two lines are parallel. Determine if…
In the real world, functions are mathematical representations of input-output situations. A vending machine is one such example. The input is the money combined with the selected button. The output is the product. Here is another example: The formula for converting a temperature from Fahrenheit to Celsius is a function expressed as: C = (5/9)*(F - 32), where F is the Fahrenheit temperature and C is the Celsius temperature. If it is 77 degrees Fahrenheit in Phoenix Arizona, then what is the equivalent temperature on the Celsius thermometer? Our input is 77. C = (5/9)*(77 - 32) C = (5/9)*(45) C = 25 The equivalent temperature is 25 degrees Celsius. To complete the Discussion activity, please do the following: Choose your own function or choose from the list below and then provide a unique example of a function and evaluate the function for a specific input (like the example above). Arm length is a function of height. The circumference of a circle is a function of diameter. The height of…

Chapter 5 Solutions

Big Java Late Objects

Ch. 5.3 - Prob. 11SCCh. 5.3 - What does this program print? Use a diagram like...Ch. 5.4 - Prob. 13SCCh. 5.4 - What does this method do? public static boolean...Ch. 5.4 - Implement the mystery method of Self Check 14 with...Ch. 5.5 - How do you generate the following printout, using...Ch. 5.5 - Prob. 17SCCh. 5.5 - Prob. 18SCCh. 5.5 - Prob. 19SCCh. 5.5 - The boxString method contains the code for...Ch. 5.6 - Consider the following statements: int...Ch. 5.6 - Consider this method that prints a page number on...Ch. 5.6 - Consider the following method that computes...Ch. 5.6 - The comment explains what the following loop does....Ch. 5.6 - In Self Check 24, you were asked to implement a...Ch. 5.7 - Explain how you can improve the intName method so...Ch. 5.7 - Prob. 27SCCh. 5.7 - What happens when you call intName(0)? How can you...Ch. 5.7 - Trace the method call intName(72), as described in...Ch. 5.7 - Prob. 30SCCh. 5.8 - Which lines are in the scope of the variable i...Ch. 5.8 - Which lines are in the scope of the parameter...Ch. 5.8 - The program declares two local variables with the...Ch. 5.8 - There is a scope error in the mystery method. How...Ch. 5.8 - Prob. 35SCCh. 5.9 - Consider this slight modification of the...Ch. 5.9 - Consider this recursive method: public static int...Ch. 5.9 - Consider this recursive method: public static int...Ch. 5.9 - Prob. 39SCCh. 5.9 - The intName method in Section 5.7 accepted...Ch. 5 - In which sequence are the lines of the Cubes.java...Ch. 5 - Write method headers for methods with the...Ch. 5 - Give examples of the following methods from the...Ch. 5 - Prob. 4RECh. 5 - Consider these methods: public static double...Ch. 5 - Prob. 6RECh. 5 - Design a method that prints a floating-point...Ch. 5 - Write pseudocode for a method that translates a...Ch. 5 - Describe the scope error in the following program...Ch. 5 - For each of the variables in the following...Ch. 5 - Prob. 11RECh. 5 - Perform a walkthrough of the intName method with...Ch. 5 - Consider the following method: public static int...Ch. 5 - Consider the following method that is intended to...Ch. 5 - Suppose an ancient civilization had constructed...Ch. 5 - Give pseudocode for a recursive method for...Ch. 5 - Give pseudocode for a recursive method that sorts...Ch. 5 - Write the following methods and provide a program...Ch. 5 - Write the following methods and provide a program...Ch. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Write methods public static double...Ch. 5 - Write a recursive method public static String...Ch. 5 - Write a recursive method public static boolean...Ch. 5 - Use recursion to implement a method public static...Ch. 5 - Use recursion to determine the number of digits in...Ch. 5 - Write a method that computes the balance of a bank...Ch. 5 - Write a method that tests whether a file name...Ch. 5 - It is a well-known phenomenon that most people are...Ch. 5 - Prob. 3PPCh. 5 - Use recursion to compute an, where n is a positive...Ch. 5 - Leap years. Write a method public static boolean...Ch. 5 - In Exercise P3.13 you were asked to write a...Ch. 5 - Prob. 10PPCh. 5 - Write a program that reads two strings containing...Ch. 5 - Prob. 12PPCh. 5 - Write a program that reads words and arranges them...Ch. 5 - Prob. 14PPCh. 5 - Write a program that reads two fractions, adds...Ch. 5 - Write a program that prints the decimal expansion...Ch. 5 - Write a program that reads a decimal expansion...Ch. 5 - Write two methods public static void...Ch. 5 - Write a program that reads in the width and height...Ch. 5 - Repeat Exercise P5.19 with hexagonal circle...Ch. 5 - Postal bar codes. For faster sorting of letters,...Ch. 5 - Write a program that reads in a bar code (with :...Ch. 5 - Write a program that converts a Roman number such...Ch. 5 - A non-governmental organization needs a program to...Ch. 5 - Having a secure password is a very important...Ch. 5 - Prob. 30PPCh. 5 - Prob. 31PPCh. 5 - Electric wire, like that in the photo, is a...Ch. 5 - The drag force on a car is given by FD=12v2ACD...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
(Display the prime numbers) Write a program that displays all the prime numbers less than 120 in decreasing ord...

Introduction to Java Programming and Data Structures, Comprehensive Version (11th Edition)

How many times will I love Java programming! be printed in the following program segment? int count = 0; while ...

Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY