Make a class describing a resistor with the following members: a private data member for the resistance, R default constructor that sets initial value to 1k. And also the overloaded constructor a public member function to set the value of R a public member function to get the value of R a public member function that takes voltage V as argument to calculate the current I a public member function that takes current I as argument to calculate the voltage V a public member function to calculate the power dissipation P from the current I using the formula P = I•V, where V is calculated using the previous member function. Make a program to test this class.Overload all arithmetic and relational operators for the objects of the class made
Comments
Leave a comment