Question
use class Program Description: Write a C++ program that begins by giving the user two options: The user can enter the 4 resistor color codes
use class
Program Description: Write a C++ program that begins by giving the user two options: The user can enter the 4 resistor color codes and the program will display the value of the resistance, tolerance, maximum resistance, and minimum resistance. The user can enter a desired resistor value and the program will determine the closest corresponding 4 color codes. Program Requirements: Write and use class Resistance as follows: Data members: include the following Resistance Tolerance 4 color bands Member functions: include the following Converting the color bands to resistance and tolerance Converting the resistance and tolerance to color bands Determine R max and R min given the resistance and tolerance Resistors are not commonly available in all values, but are typically available in standard values. Determine the nearest standard resistance value given the desired resistance and tolerance. The following link provides a table of standard values http://www.resistorguide.com/resistor-values/. Round up if the value is exactly half way between two standard values. Additional member function requirements: Each member function should provide error checking to make sure the inputs are valid Do not use global variables Do not display the results inside the function Give the end user the option to rerun the program and re-enter values Valid/invalid inputs are Option 1: Input colors should be accepted using any combination of upper and lower case Allow input color bands to corresponding to resistance values 0.1 ohm to 100,000,000 ohms (100M) Option 2: Allow input resistance values from 0.1 ohms to 100,000,000 ohms (100M) Only allow tolerances of 1 %, 5%, 10%, or 20% Standard resistor values; Standard resistors are generally available with the following values (multiplied by 10N) from 0.1 to 100 M For example, the overlap ranges for a 10% resistor values: k represents 0.9 - 1.1 k 1.2 k represents 1.08 - 1.32 k 1.5 k represents 1.08 - 1.65 k 1.8 k represents 1.62 - 1.98 k 2.2 k represents 1.98 2. 42 k E12 series (tolerance 10%) 0 12 15 18 22 27 33 39 47 56 68 82 E24 series (tolerance 5% and 1%) 10 11 12 13 15 16 18 20 22 24 27 30 33 36 39 43 47 51 56 62 68 75 82 91 E6 series (tolerance 20%) 10 15 22 33 47 68
Step 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