http://nopaste.info/f04ff361f6.html - code
OFFLINE

OFFLINE
int maxColumns = 5;
int maxValues = int((inputEnd-inputStart+increment)/increment); // with +increment, otherwise you won't get the last value
for(int i=0;i<=maxValues;i += maxcolumns) { // for each block of at most maxColums with do ...
float start = inputStart + increment*i; // start for following output block
float end = min(inputStart+increment*(i+1), inputEnd) // end for output block, which is either max value or the max you want to print
for(float j=start;j<=end;j+=increment) {
// do the magic you already have
}
cout<<endl;
}
OFFLINE
int maxColumns = 5;
int maxValues = int((interestRange2-interestRange1+Increment)/Increment); // with +increment, otherwise you won't get the last value
for(int i=0;i<=maxValues;i += maxColumns)
{ // for each block of at most maxColums with do ...
float start = interestRange1 + Increment*i; // start for following output block
float end = min(interestRange1+Increment*(i+1), interestRange2); // end for output block, which is either max value or the max you want to print
for(float j = start;j<=end;j +=Increment)
{
for (int i = yearRange1; i <= yearRange2; i++)
{
cout<<"Year "<<i<<"\t ";
outfile<<"Year "<<i<<"\t ";
for(double j = interestRange1; j <= interestRange2;j++)
{
cout<<fixed<<showpoint<<setprecision(5)<<paymentfac(interestRange1,yearRange1)<<"\t";
outfile<<fixed<<showpoint<<setprecision(5)<<paymentfac(interestRange1,yearRange1)<<"\t";
j = j - 0.75;
interestRange1 = interestRange1 + Increment;
while (interestRange1 > interestRange2 && yearRange1 < yearRange2)
{
interestRange1 = 8.00;
yearRange1 = yearRange1 + 1;
}
}
cout<<endl;
outfile<<endl;
} // do the magic you already have
}
}

OFFLINE
int maxColumns = 5;
int maxValues = int((inputEnd-inputStart+increment)/increment); // with +increment, otherwise you won't get the last value
for(int i=0;i<=maxValues;i += maxcolumns) { // for each block of at most maxColums with do ...
float start = inputStart + increment*i; // start for following output block
float end = min(inputStart+increment*(i+1), inputEnd) // end for output block, which is either max value or the max you want to print
for(int y=yearStart;y<yearEnd;y++) {
for(float j=start;j<=end;j+=increment) {
// do the magic you already have, but no simple copy-paste :P
// Basicly, only get the values based on year y and startvalue j and print those
}
}
cout<<endl;
}
OFFLINE

OFFLINE
OFFLINE
OFFLINE
code.jpg 89.77K
15 downloads
OFFLINE

OFFLINE
OFFLINE
OFFLINE
OFFLINE
OFFLINE
OFFLINE
|
Help & Discussion Center →
Software & PC Support →
Coder's Corner →
c++ variables?Started by Corey, 17 Nov 2011 |
|
|
0 members, 1 guests, 0 anonymous users