Question: 1. Enter the program at the bottom into your C++ IDE (codeblocks or other) 2. Run it and figure out what it does 3. Modify
1. Enter the program at the bottom into your C++ IDE (codeblocks or other)
2. Run it and figure out what it does
3. Modify the program to plot the curve y = abs(4x3 x4{"version":"1.1","math":""} )but choose a range that will display properly in the width of your console window (try some sample values to find an acceptable range. You may also adjust the scale factor.
4. Here is a simple RC circuit. The switch is closed at time t=0 when the voltage V across the capacitor is given by the equationV = E[1 etRC]{"version":"1.1","math":""}
where E is the voltage of the battery, R is the circuit resistance, C is the value of the capacitor and t is in seconds. Assuming that E=50, R=4000, and C=0.005, modify the program to plot the voltage across the capacitor from t=0 to t=30, in increments of 1 second

5. Demonstrate programs from step 3 and step 4
6. Extra Credit - automatically determine a good scale_factor and range that will generate a good display in a typical console window.
-------------------------------------------------------------------------
#include
using namespace std;
int main() { int x,y;
int scale_factor=1; char label[]=" y axis"; char axis[]="+------------------------------------------------------>";
cout
for (x=1; x
y = (pow((x-8),2.0) + 3) / scale_factor; // y = abs( (int) (4*pow((x),2.0) - pow((x),4.0)))/10;
char line[y]; line[y-1] = 0; for (int pos=0;pos
cout
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
