Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How do I get x[i] to calculate. Answer should be: 0.15 0.30 0.45 0.60 0.75 0.90

ID: 3547536 • Letter: H

Question

How do I get x[i] to calculate. Answer should be:


0.15  0.30  0.45   0.60  0.75  0.90   1.05  1.20   1.35  1.50



#include<iostream>
#include<cmath>
using namespace std;

int main()

{
    int A=9660, n, i;
    double time, delta_x, y[200],x[200],y1;
    //To calculate the value of y from the time=0.
    cout<<"Enter the number of y values you want to use."<<endl;
    cin>>n;
    
    delta_x=1.5/n;
    cout<<delta_x<<endl;
    cout<<endl;
    
    for(i=0;i<n;i++)
    {
        
        x[i]=delta_x + x[i] ;
        cout<<x[i]<<"  ";
        
    }
    
      
return 0;

}






Enter the number of y values you want to use.
10
0.15

0.15  0.15  0.15  0.15  0.15  0.15  0.15  0.15  0.15  0.15
--------------------------------
Process exited with return value 0
Press any key to continue . . .

Explanation / Answer

0.15 0.30 0.45 0.60 0.75 0.90 1.05 1.20 1.35 1.50



#include<iostream>
#include<cmath>
using namespace std;

int main()

{
int A=9660, n, i;
double time, delta_x, y[200],x[200],y1;
//To calculate the value of y from the time=0.
cout<<"Enter the number of y values you want to use."<<endl;
cin>>n;

delta_x=1.5/n;
cout<<delta_x<<endl;
cout<<endl;

for(i=0;i<n;i++)
{
  

if (i > 0)
x[i]=delta_x + x[i-1] ;
else

x[i] = delta_x;


cout<<x[i]<<" ";

}


return 0;

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote