Question: #include #include using namespace std; class Circuit { public: Circuit(double voltageValue, double currentValue); void Print(); private: double voltage; double current; }; Circuit::Circuit(double voltageValue, double currentValue)
#include #include using namespace std; class Circuit { public: Circuit(double voltageValue, double currentValue); void Print(); private: double voltage; double current; }; Circuit::Circuit(double voltageValue, double currentValue) { voltage = voltageValue; current = currentValue; } void Circuit::Print() { cout << "Circuit's voltage: " << fixed << setprecision(1) << voltage << endl; cout << "Circuit's current: " << fixed << setprecision(1) << current << endl; } int main() { Circuit* myCircuit = nullptr; double voltageValue; double currentValue; cin >> voltageValue; cin >> currentValue; /* Your code goes here */ myCircuit->Print(); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
