Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <string>
- #include <thread>
- #include <fstream>
- using namespace std;
- void starter();
- void menu();
- void wybor();
- void listaslowek();
- void noweslowko();
- void informacje();
- void powrot();
- void koniec();
- void usunslowko();
- void test();
- int main()
- {
- starter();
- menu();
- }
- void starter()
- {
- cout << "||||||||||||||||||" << endl;
- cout << "||| ENGLISH |||" << endl;
- cout << "|||| TEST ||||" << endl;
- cout << "||||||||||||||||||" << endl;
- system("PAUSE");
- }
- void koniec()
- {
- system("CLS");
- for (int i = 5; i > 0; i--)
- {
- cout << i;
- this_thread::sleep_for(chrono::seconds(1));
- system("CLS");
- }
- cout << endl << "Press any button to exit..." << endl;
- }
- void powrot()
- {
- system("PAUSE");
- menu();
- }
- void listaslowek()
- {
- system("CLS");
- string slowko;
- cout << "List of words:" << endl;
- fstream lista;
- lista.open("lista.txt", fstream::in);
- while (lista >> slowko)
- {
- cout << slowko << endl;
- }
- powrot();
- }
- void noweslowko()
- {
- system("CLS");
- string NewWord;
- cout << "Write new word: ";
- cin >> NewWord;
- ofstream lista;
- lista.open("lista.txt", ofstream::app);
- lista << endl << NewWord;
- lista.close();
- cout << endl << "Word '" << NewWord << "' has been successfully added" << endl;
- powrot();
- }
- void usunslowko()
- {
- system("CLS");
- string DeletedWord;
- cout << "Write a word to delete: ";
- cin >> DeletedWord;
- cout << endl << "Word '" << DeletedWord << "' has been successfully deleted" << endl;
- powrot();
- }
- void test()
- {
- system("CLS");
- cout << "in progress..." << endl;
- powrot();
- }
- void informacje()
- {
- system("CLS");
- cout << "The English test made for a math class!" << endl;
- cout << endl << "List of words: [LICZBA WSZYSTKICH SLOWEK]" << endl;
- cout << "Creators: Przemek Szumczyk & Bartek Modliszewski" << endl;
- cout << "License: GNU General Public License" << endl;
- powrot();
- }
- void wybor()
- {
- char liczba;
- cout << "Select the tab: ";
- cin >> liczba;
- switch (liczba)
- {
- case '1': listaslowek(); break;
- case '2': noweslowko(); break;
- case '3': usunslowko(); break;
- case '4': test(); break;
- case '5': informacje(); break;
- case '6': koniec(); break;
- }
- }
- void menu()
- {
- system("CLS");
- cout << "1. List of words" << endl;
- cout << "2. Add word" << endl;
- cout << "3. Remove word" << endl;
- cout << "4. TEST!!!" << endl;
- cout << "5. Informations" << endl;
- cout << "6. Shut down" << endl;
- wybor();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement