Divided classes appended them to one main
This commit is contained in:
34
main.cpp
Normal file
34
main.cpp
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "newton/Newton.cpp"
|
||||||
|
#include "horner/horner_class.cpp"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// Schemat hornera test part
|
||||||
|
|
||||||
|
float x = 0;
|
||||||
|
Wielomian wielomian;
|
||||||
|
cout << "Program do obliczenia wielomianu schematem hornera\n";
|
||||||
|
|
||||||
|
cout << "Podaj x dla ktorego szukamy rozwiazania: ";
|
||||||
|
cin >> x;
|
||||||
|
wielomian.readFromFile("dane.txt");
|
||||||
|
wielomian.setX(x);
|
||||||
|
wielomian.oblicz();
|
||||||
|
wielomian.wyswietl_wynik();
|
||||||
|
wielomian.reverse_a();
|
||||||
|
|
||||||
|
cout << "\nWynik rekurencyjny: " << wielomian.oblicz_rekurencyjnie(wielomian.getStopien() - 1) << endl;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Newton test part
|
||||||
|
|
||||||
|
Newton first;
|
||||||
|
first.readFromFile("input.txt");
|
||||||
|
// first.wyswietl_x_y();
|
||||||
|
first.wyswietl_tabela();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -54,16 +54,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float a, b;
|
float a, b;
|
||||||
vector<float> x ,y;
|
vector<float> x ,y;
|
||||||
};
|
};
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Newton first;
|
|
||||||
first.readFromFile("input.txt");
|
|
||||||
// first.wyswietl_x_y();
|
|
||||||
first.wyswietl_tabela();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user