Question: Goals: Developing problem-solving skills, using single branched ifs to check validity of input, and using multi-branched decision structures. Problem: You have been hired by a

Goals: Developing problem-solving skills, using single branched ifs to check validity of input, and using multi-branched decision structures. Problem: You have been hired by a company to aid in calculating the resistance of some wires of different materials, cross sections, and lengths. The resistance of a wire can be calculated from the equation R=ALp where R is the resistance of the length of wire, L is the length of the wire, A is the cross-section of the wire and p is the resistivity of the wire composition. The resistivity of various materials is given in the table below. You should create a program that will calculate the resistance of a wire given the material composition and dimensions of the wire. All the wires are cylindrical so the cross sections will be circles. Your program should prompt the user to enter the length and radius of the wire in centimeters and confirm these values are valid using simple-ifs (single-branched ifs) for each value. The user should be prompted to select the material by using the first character of the material name, e.g. 'A' or ' a ' for Aluminum, ' Z ' or ' z ' for Zinc, etc. The user should be allowed to enter either an upper case or lower case character to select the material. The validity of the character should be confirmed using a simple-if (single-branched if). You should assume that the user will not enter an invalid value for a specific variable more than once. Next your program should use a multi-way branch (either if-else if or switch) structure to assign the resistivity for entered material and store the name of the material in a string object based on the entered single character. The resistance of the specific wire should be calculated and a "A wire with a cross section of square centimeters and a length of centimeters has a resistance of ohms." Jse appropriate data types for entered values. The dimensions should be floating-point values. Jse formatting concepts from Chapter 3 to output the cross section and length should be to 5 ignificant digits and the resistance to 3 significant digits. Note that numbers can be assigned sing scientific notation, e.g. x=3.567E5; can be used to store 0.00003567 in x. or example if copper was chosen as the material, the radius was 0.5cm, and the length was 10 m, the following output should be generated when pi is defined as 3.14159. copper wire with a cross section of 0.78540 square centimeters and length of 10.000 centimenters has a resistance of 2.16e05 ohms. pess any key to continue... esign your code so that similar calculations or output statements are not repeated in every ranch. Do not put any calculations in cout statements. Do not use concepts beyond Chapter 4 of your textbook (e.g. repetition and rogrammer-built functions) and make sure you allow user to enter invalid data again nce, not just end the program. Remember that all coding submissions should contain ntroductory comments (before any C++ code) that includes the problem being solved or urpose of the program, input needed, output expected, and processing needed to get the utput from the input (no C++ code should be given here). Have these introductory omments written before you ask for help. You should assume the user will not enter nvalid data more than once. Make sure that you follow the assignment guidelines
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
