Electric wire is a cylindrical conductor covered


Electric wire is a cylindrical conductor covered by an insulating material. The resistance of a piece of wire is given by the formula
where ρ 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 speci?ed by the American wire gauge (AWG), which is an integer, n. The diameter of an AWG n wire is given by the formula
Write a C++ function
double diameter(int wire_gauge)
that accepts the wire gauge and returns the corresponding wire diameter. Write another C++ function
double copper_wire_resistance(double length, int wire_gauge)
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 x 10-8 Ω m. Write a third C++ function
double aluminum_wire_resistance(double length, int wire_gauge)
that accepts the length and gauge of a piece of aluminum wire and returns the resistance of that wire. Write a C++ program to test these functions. 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. The program should give the user the option whether to continue with computing the resistances (i.e. entering letter 'C') or exit the program (i.e. entering the letter 'E').
Sample Output:

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: Electric wire is a cylindrical conductor covered
Reference No:- TGS0426409

Expected delivery within 24 Hours