Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C language question Consider the following data regarding the resistance of various metals: Resistance of a metal- resistivity *length of wire I area of wire

C language questionimage text in transcribed

Consider the following data regarding the resistance of various metals: Resistance of a metal- resistivity *length of wire I area of wire Resistivity of silicon = 2.3 * 10^-3 Resistivity of copper = 1.7 * 10-8 Length 1, 85 Diameter (in mm) = 5, 2 Instructions Write a function (not main) that can accept as input parameters a string representing a metal name, the resistivity of the metal, the length of a wire, and the diameter of a wire. The function should calculate the resistance of a metal, given the formula above, and should print the result to the console. You should output all of the items you used to calculate the resistivity, and what the result was. For example, you might print the following statement: Resistance of Copper wire with resistivity of .0023 and length of 1 meter and diameter of 2 mm is: .37456 Inside your main function, call the function you made at least two times passing it different values. NOTE: To accept a string as a parameter to a function, you would specify the char [1, as follows: ....madeup_function (char some_string_parameter[,... another parameter...etc. Think about the types of numbers you should accept. Will they be whole numbers, or floating point numbers? How large might they be? What data type should you use for input and output? Hints: The math library includes constants (variables whose values cannot be modified) and functions useful for math. If you include the library, you can use them as-if you had created them in your file. Here are a few that might be helpful: M-PI-value of 11 MPI-4-value of /4 result pow(number, power you want to raise it to)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions