Sketching curve

Recently i have an assignment to do,
it is about sketching a curve.
this is my code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace std;
#include "svgforpa1.h"

int main() {
int x1=-100, y1, x2, y2,d,c1,c2,c3,c4 ;
cout<<"Enter the degree of the polynomial"<<endl;
cin>>d>> endl; 
   if (d==3)
   cout<<"For the polynomial f(x)=C1*x^3+C2*x^2+C3*x^1+C4, enter C1, C2, C3, C4 in order:"<<endl;
   else if (d==2)
   cout<<"For the polynomial f(x)=C2*x^2+C3*x^1+C4, enter C2, C3, C4 in order:"<<endl;
   else if (d==1)
   cout<<"For the polynomial f(x)=C3*x^1+C4, enter  C3, C4 in order:"<<endl;
   else
   cout<<"For the polynomial f(x)=C4, enter C4 :"<<endl;
cin>>c1>>c2>>c3>>c4>>endl; 
    svgout<<"line"<<0<<1000000<<200<<1000000<<"1 green";
    svgout<<"line"<<100<<0<<100<<2000000<<"1 green";
    while (x1<100)
    {x2=x1+1;
    y1=c1*x1*x1*x1+c2*x1*x1+c3*x1+c4;
    y2=c1*x2*x2*x2+c2*x2*x2+c3*x2+c4;
    svgout << "line" << x1+100 << y1 << x2+100 << y2 << "1 blue";
    x1=x1+1;
    }



	return 0;
}

However, the complier said that i get "no match for operator in "for line 8&17
What is the problem here?
thx a lot!
cin >> endl?
That's not right. How do you expect that to work?
o thx.
i try to correct that as cin>>d;
but the problem still remains.
You need to fix it in line 17 as well...
actually i fixed both lines..
but the problem still remains..
Doubtful.
Post the new source and copy & paste the exact error message(s).
oh, now the problem has fixed
but the output is not correct
it seems it is the logic problem now..
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace std;
#include "svgforpa1.h"

int main() {
	int x1=-100, y1, x2, y2,d,c1,c2,c3,c4 ;
	cout<<"Enter the degree of the polynomial"<<endl;
	cin>>d;
	if (d==3)
	cout<<"For the polynomial f(x)=C1*x^3+C2*x^2+C3*x^1+C4, enter C1, C2, C3, C4 in order:"<<endl;
	else if (d==2)
	cout<<"For the polynomial f(x)=C2*x^2+C3*x^1+C4, enter C2, C3, C4 in order:"<<endl;
	else if (d==1)
	cout<<"For the polynomial f(x)=C3*x^1+C4, enter  C3, C4 in order:"<<endl;
	else
	cout<<"For the polynomial f(x)=C4, enter C4 :"<<endl;
	cin>>c1>>c2>>c3>>c4;
    svgout<<"line"<<0<<1000000<<200<<1000000<<"1 green";
    svgout<<"line"<<100<<0<<100<<2000000<<"1 green";
    while (x1<100)
    {x2=x1+1;
    y1=c1*x1*x1*x1+c2*x1*x1+c3*x1+c4;
    y2=c1*x2*x2*x2+c2*x2*x2+c3*x2+c4;
    svgout << "line" << x1+100 << 1000000-y1 << x2+100 << 1000000-y2 << "1 blue";
    x1=x1+1;
    }



	return 0;
}
Then you need to tell exactly what about the output is not correct and what you expected.
Also, you should post svgforpa1.h.
ya, that is the problem..
school has given us a grading program to check
also i can't see the output of the graph
by using IE

svgforpa1.h is too large
If you right click the top part of the console window, and choose "Edit -> Select All" then "Edit -> Copy", you can paste it in here.
Topic archived. No new replies allowed.