Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~819 People Reached
Favorite Forums
Favorite Tags
c++ x 3
Member Avatar for Jin En

#ifndef CIRCUIT_H #define CIRCUIT_H #include <iostream> using namespace std; class Resistor { public: void setResistance(double); double getResistance(); double GenerateRandomCircuit(); double calctotalResistance(); void GenerateQuiz(); int op[7],res[8]; private: double r; }; #endif // CIRCUIT_H #include "Circuit.h" #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> using namespace std; void Resistor::setResistance(double r1) { r=r1; …

Member Avatar for rproffitt
0
591
Member Avatar for Jin En

double Node::ConvertChar(char key[]) { double value; value=atof(key); return value; } void Node::ConvertFormula(string formula,int resistor,vector <Resistor> &Res,vector <double> &OpArray){ int Operator=resistor-2; resistor=resistor-1; int length=formula.length(); int j=length-4; double resistance; while(length>0) { char temp[3]; int x=1; for(int i=2;i>=0;i--) { temp[i]=formula[length-x]; x++; } resistance=ConvertChar(temp); Res[resistor].SetResistance(resistance); resistor--; while(j>0) { if(formula[j]=='+') { OpArray[Operator]=-1.0; }else { OpArray[Operator]=-2.0; …

Member Avatar for Dani
0
105
Member Avatar for Jin En

I need help with random generation of circuit, i have no idea on how to write c++ program to generate random circuit. The following specifications must met: 1) Total number of resistors in the circuit is between 3 and 8. 2) The circuit network layout is restricted only to the …

Member Avatar for rproffitt
0
123