Question: Please do as the method given using private and puplic classes Write a simple C++ console application that creates two classes. The first class will

Please do as the method given using private and puplic classes  Please do as the method given using private and puplic classes

Write a simple C++ console application that creates two classes. The first class will implement a resistor with private data members of; resistance and current; provide a constructor that will initialize these members; and provide public methods ChangeResistance(...), BandResistance(..), ChangeCurrent ResistanceVal), CurrentVal), and VoltageVal(). The class can implement other members/methods as needed. This Class is used to store the resistance and current, changing these values will be done by passing an argument to the method. In other words, values for resistance and current will be entered in main and then passed to the class method to become private. Reading these private values can only be done by a method of the class. Method descriptions ChangeResistance(passed parameter) Is a method that will change the resistance with the parameter that is passed. BandResistance(passed parameters) Will change the resistance based on 3 color strings that are passed as parameters (Like Lab 5 only no tolerance) ChangeCurrent(passed parameter) Is a method that will change the current with the parameter that is passed. ResistanceVal(void), CurrentVal(void),VoltageVal(void) Each will return the corresponding variable or calculation. The second class will implement power and be a derived class from the first class. This class will provide a method to return the power. The Main routine of this program will contain a variable of only the second class. A menu system will be used to enter values and call corresponding methods (Resistance, Band Colors, Current, and Exit). Upon changing a value all variables will be printed (Resistance, Voltage, Current, and Power). The program will loop until the exit menu item is selected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!