Divided classes appended them to one main

This commit is contained in:
2024-11-06 13:50:50 +01:00
parent 918246c55d
commit 677aa8a90f
2 changed files with 37 additions and 10 deletions

34
main.cpp Normal file
View 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;
}

View File

@@ -54,16 +54,9 @@ public:
}
}
private:
float a, b;
vector<float> x ,y;
};
int main()
{
Newton first;
first.readFromFile("input.txt");
// first.wyswietl_x_y();
first.wyswietl_tabela();
return 0;
}
};