Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
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 messageStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started