Advertisement
Guest User

Untitled

a guest
Jan 25th, 2016
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.70 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <string>
  4. #include <vector>
  5. using namespace std;
  6.  
  7. #define ID_EXIT 0
  8. #define ID_WYSWIETL 1
  9. #define ID_DODAJ 2
  10. #define ID_USUN 3
  11. #define ID_EDYTUJ 4
  12.  
  13. class Student{
  14.     public:
  15.         Student(string imie, string nazwisko, string kierunek, float srednia);
  16.         string nazwisko;
  17.         string kierunek;
  18.         float srednia;
  19. };
  20. Student::Student(string imie, string nazwisko, string kierunek, float srednia){}
  21.  
  22. class Baza{
  23.     public:
  24.         ~Baza(); ///czyszczenie kontenera
  25.         bool AddEl(string imie, string nazwisko, string kierunek, float srednia);
  26.         bool EditEl(vector < Student >::iterator it);
  27.         bool EraseEl(vector < Student >::iterator it);
  28.         FILE * LoadFile(char * sciezka);
  29.         void ReadFileAndFillData(FILE *file);
  30.     private:
  31.         vector<Student> Baza;
  32.  
  33. };
  34. Baza::~Baza(){}
  35. bool Baza::AddEl(string imie, string nazwisko, string kierunek, float srednia){}
  36. bool Baza::EditEl(vector < Student >::iterator it){}
  37. bool Baza::EraseEl(vector < Student >::iterator it){}
  38. FILE * Baza::LoadFile(char * sciezka){}
  39. void Baza::ReadFileAndFillData(FILE *file){}
  40.  
  41. class Baza Studenci;
  42.  
  43.  
  44.  
  45.  
  46. int main()
  47. {
  48.     Studenci.ReadFileAndFillData(Studenci.LoadFile("baza_danych.txt"));
  49.     int wybor;
  50.     while(true)
  51.     {  
  52.         cin >> wybor;
  53.         switch(wybor)
  54.         {
  55.             case ID_EXIT:
  56.                 delete Studenci;
  57.                 return 0;
  58.             case ID_DODAJ:
  59.                 string imie, nazwisko, kierunek;
  60.                 float srednia;
  61.                 /// cin cin cin cin
  62.                 Studenci.AddEl(imie, nazwisko, kierunek, srednia);
  63.                 break;
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement