Table of numbers

My assignment is to make a table of numbers to use in a math problem.
Ask the user for three numbers:
The first number represents how many values are to be in the table. (1 to 25)
The second number represents the first value in the table. (-1000 to +1000)
The third number represents the increment between successive values in the table. (1 to 20)
The values have to generated and displayed using square,square root, cube, and cube root.

I have worked on this for a while and I would appreciate it if someone could help me get started on this project. Here is what I have so far.

#include "stdafx.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <cmath>
#include <cctype>
#include <ctime>
using namespace std;

int main( )
{

double sqrt( double x);
float sqrt( float x );
long doublesqrt( long double x );

cout << "How many values should the table contain (1-25)? " << endl;

double x, y, z;
for ( int i=0; i<26; i++)
{
x = i;
y = sqrt( i * 25.0 );
z = pow( sqrt( i * 25.0 ), sqrt( 4.0 ) );
cout << "i=" << i << ", \tx=" << x <<
", \ty=" << y << ", \tz=" << z << endl;
}
cout << "What number represents the first value in the table (-1000 - +1000)? " << endl;



system("pause");
return 0;
}

Last edited on
For starters I would lose the semi-colon after the for() that shouldn't be there. Then I might edit my post to use code tags. Look for the <> button.
Topic archived. No new replies allowed.