Model an ideal transformer where V1/V2 = N1/N2 and i1/i2 = N2/N1 provide functions iOut and vOut to calculate current or voltage out provide setI1forI2 (etc) to calculate internal variables for a given output

What will be an ideal response?

```
#include
using namespace std;

class Transformer {
public:
Transformer() {} // default constructor
Transformer(int, int, double, double); // construct with N1 N2 V1 i1
double vOut() const; // calculates voltage out
double iOut() const; // calculates current out
void setN1forV2(double); // set a variable for a given output
void setN2forV2(double);
void setV1forV2(double);
void setI1forI2(double);
void setN1forI2(double);
void setN2forI2(double);

private:
int N1, N2;
double V1, i1;

friend istream& operator>> (istream&, Transformer&);
friend ostream& operator<< (ostream&, const Transformer&);
};

```

Computer Science & Information Technology

You might also like to view...

A_______ is a nonlinear, two-dimensional data structure with special properties.

a) tree. b) linked list. c) queue. d) None of the above.

Computer Science & Information Technology

ADMX and ADML files are placed under what directory within Windows?

A. %systemroot%\Policies B. %systemroot%\PolicyDefinitions C. %systemroot%\Policies\Security D. %systemroot%\System32\Policy

Computer Science & Information Technology