|
-
September 18th, 2011, 01:06 PM
#1
C++ substituting variables for values
Hello everybody. I am a beginner at C++ and have a lab assignment due that i am a little lost on. The lab states that i must create a table using iomanipulators, setw, setprecision, and setiosflags that shows current i, Vr, Vcap, and Vr+Vcap with respect to time. The given formulas are i=E*(pow(e,(-t/(R*C)))/R), Vr=i*R, and Vcap = E*(1-pow(e,(-t/(R*C)))). I have already programmed these and have defined all variables, include t1-t5 (.01s,.05s,.1s,1s,5s) as floats. Values for e, E, R, and C are given. My problem is that i am unsure how to plug different values of t into the equations to get an appropriate output for each section of the table. I know i must cin the time values, but i'm lost as to what to do after that. Could somebody please help?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|