well i tryed changing this around alot and this is the way i have it and got the least amount of errors i was trying to make a node but it really didnt work out.. this was just to get used to them no real point in it..
ok well i have left the part i think is wrong in red..
Code:#include <iostream> using namespace std; struct node { int start_up; float p; int position; int sprint; int total; node* next; }; class database { private: node one; node two; node three; one.next = &two; two.next = &three; public: void football_one(); void football_two(); void football_three(); }; void database::football_one() { cout<<"How long it the start up. (in yards)"<<endl; cin>> one.start_up; cout<<"How long is the sprint? (in yards)"<<endl; cin>> one.sprint; one.total = one.start_up + one.sprint; cout<<"you have to run :"<<one.total<<" yards."<<endl; cout<<"Now to find out how fast you will run. \nEnter you yard position"<<endl; cin>> one.position; cout<<"You will be running at :"; if ((100 * one.position) / one.sprint >= one.sprint) { cout<<"100%"<<endl; } else { one.p = (100 * one.position) / one.sprint; cout<< one.p<<"%"<<endl; } } void database::football_two() { cout<<"How long it the start up. (in yards)"<<endl; cin>> two.start_up; cout<<"How long is the sprint? (in yards)"<<endl; cin>> two.sprint; one.total = two.start_up + two.sprint; cout<<"you have to run :"<<two.total<<" yards."<<endl; cout<<"Now to find out how fast you will run. \nEnter you yard position"<<endl; cin>> two.position; cout<<"You will be running at :"; if ((100 * two.position) / two.sprint >= two.sprint) { cout<<"100%"<<endl; } else { one.p = (100 * two.position) / one.sprint; cout<< three.p<<"%"<<endl; } } void database::football_three() { cout<<"How long it the start up. (in yards)"<<endl; cin>> three.start_up; cout<<"How long is the sprint? (in yards)"<<endl; cin>> three.sprint; one.total = three.start_up + three.sprint; cout<<"you have to run :"<<three.total<<" yards."<<endl; cout<<"Now to find out how fast you will run. \nEnter you yard position"<<endl; cin>> three.position; cout<<"You will be running at :"; if ((100 * three.position) / three.sprint >= three.sprint) { cout<<"100%"<<endl; } else { one.p = (100 * three.position) / one.sprint; cout<< three.p<<"%"<<endl; } } int main() { football_one(); football_two(); football_three(); }