Question: Programming in Java: Electric wire, like that in the photo, is a cylindrical conductor covered by an insulating material. The resistance of a piece of

Programming in Java:

Programming in Java: Electric wire, like that in the photo, is a

cylindrical conductor covered by an insulating material. The resistance of a piece

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 where p is the resistivity of the conductor, and L, A, and d are the length, cross-sectional area, and diameter of the wire. The resistivity of copper is 1.678 x 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 36-n d= 0.1279239 mm Write a Java class to compute and print out the resistance of copper and aluminum wire. Use the following class, and you add instance variables, constructors, and other methods public class WireResistance I/ Takes the write gauge and returns the corresponding wire diameter double computeDiameter (int wireGauge) // Takes the length and gauge of a piece of copper wire and returns the resistance of that wire. double computeCopperWireResistance (double length, int wireGauge) ( II Takes the length and gauge of a piece of aluminum wire and returns the resistance of that wire. The resistivity // of aluminum is 2.82 x 10-8 m double computeAlumWireResistance (double length, int wireGauge) public static void main(String[] args) Your program should validate user input for the wire gauge and wire length (i.e. prevent computation of zero or negative wire gauge or length) and displays the precision of the output resistance to three decimal points. Here is a sample output with no description message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!