Hello,
Could you please see the attached question?
(A)
//code
#include<iostream>
#include<cmath>
#include<fstream>
using namespace std;
int main()
{
float V[20][20], V0[18][18], diff[18][18];
int i, j;
for (i=0;i<=19;i++)
{
for (j=0;j<=19;j++)
{
V[0][j] =
0.0;
V[19][j] = 1.0;
V[0] = (i)/19.0;
V[19] =
(i)/19.0;
}
}
for (i=1; i<=18; i++)
{
for (j=1; j<=18; j++)
{
V[j]=1.0;
}
}
float maxdiff, sum, diffsum;
int count=0;
for(i=1;i<=18;i++)
{
for(j=1; j<=18; j++)
{
diff[j]=1.0;
}
}
maxdiff=0.0001;
diffsum=1.0;
while (diffsum >= maxdiff)
{
sum = 0.0;
for (i=1; i<=18; i++)
{
for (j=1;
j<=18; j++)
{
V0[j] = V[j];
V[j] = ((V[i+1][j] + V[i-1][j] + V[j+1] +
V[j-1])/4.0);
diff[j] = (V0[j]
- V[j]);
sum = sum + diff[j];
}
}
diffsum=sum/(18 * 18);
count++;
}
cout<< count;
}
Hello, Could you please see the attached question? Given: January 6, 2017 Due: February 6, 2017...
Please answer showing all working!
DELL Question #2 See the Time Value of Money Table Attached at Back of Exam On January 1, 2017, Andres Inc. signed a 6-year non-cancelable lease for a printing press. The terms of the lease called for Andres to make annual payments of $54,291.43 at the beginning of each year, starting January 1, 2017. The printing press has an estimated useful life of 6 years and a $10,000 unguaranteed residual value. The printing press reverts...