Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "BazaTestu.hh"
- #include "Statystyka.hh"
- using namespace std;
- int main(int argc, char **argv)
- {
- if (argc < 2) {
- cout << endl;
- cout << " Brak opcji okreslajacej rodzaj testu." << endl;
- cout << " Dopuszczalne nazwy to: latwy, trudny." << endl;
- cout << endl;
- return 1;
- }
- BazaTestu BazaT = { nullptr, 0, 0 };
- if (InicjalizujTest(&BazaT,argv[1]) == false) {
- cerr << " Inicjalizacja testu nie powiodla sie." << endl;
- return 1;
- }
- cout << endl;
- cout << " Start testu arytmetyki zespolonej: " << argv[1] << endl;
- cout << endl;
- WyrazenieZesp WyrZ_PytanieTestowe;
- LZespolona odp;
- Statystyka staty = { 0, 0 };
- while (PobierzNastpnePytanie(&BazaT,&WyrZ_PytanieTestowe)) {
- cout << " Podaj wynik operacji: ";
- cout << WyrZ_PytanieTestowe.Arg1;
- cout << ZwrocSymbol(WyrZ_PytanieTestowe.Op);
- cout << WyrZ_PytanieTestowe.Arg2;
- cout << endl;
- cout << " Twoja odpowiedz: " ;
- cin >> odp;
- if(odp == Oblicz(WyrZ_PytanieTestowe))
- {
- cout << " Odpowiedz poprawna" << endl;
- staty.iloscPrawidlowychOdp++;
- staty.iloscWszystkichOdp++;
- }
- else
- {
- cout << " Blad. Prawidlowym wynikiem jest: "<< Oblicz(WyrZ_PytanieTestowe)<< endl;
- staty.iloscWszystkichOdp++;
- }
- cout << endl;
- }
- cout << "Ilosc dobrych odpowiedzi: " << staty.iloscPrawidlowychOdp << endl;
- cout << "Ilosc blednych odpowiedzi: " << staty.iloscWszystkichOdp - staty.iloscPrawidlowychOdp << endl;
- cout << "Wynik procentowy poprawnych odpowiedzi: ";
- WyswietlProcenty(staty);
- cout << endl;
- cout << endl;
- cout << " Koniec testu" << endl;
- cout << endl;
- }
Add Comment
Please, Sign In to add comment