Ohm's law
Make a class describing a resistor with the following members:
- a private data member for the resistance, R
- a public member function to set the value of R
- a public member function to calculate the current I from
the voltage E
- a public member function to calculate the voltage E from
the current I
- a public member function to calculate the power
dissipation P from the current I using the formula P =
I·E, where E is calculated using the previous member
function.
Make a program to test this class.