i don't need help writing the c++ code, but i do need help calculating the power through the resistor. P=VI and P = I^2R aren't working, so I'm guessing it's got something to do with circuit analysis, which i haven't been taught yet, and that my c++ class hasn't gone over.
------2 ohms----...