Advertisement
Guest User

Untitled

a guest
Sep 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <conio.h>
  4.  
  5. using namespace std;
  6.  
  7. struct WordCard
  8. {
  9. char word[100];
  10. char trans;
  11. };
  12.  
  13. class Dictionary
  14. {
  15. public:
  16. char name[];
  17. WordCard card[100];
  18. friend istream &operator>>(istream &stream, Dictionary &ob);
  19. Dictionary(char);
  20. void greate();
  21. void show();
  22. void search();
  23. Dictionary operator+(Dictionary ob);
  24. Dictionary operator-(Dictionary ob);
  25. Dictionary operator/(Dictionary ob);
  26. };
  27.  
  28. Dictionary::Dictionary(char n[])
  29. {
  30. strcpy(this->name,n);
  31. }
  32.  
  33. istream &operator>>(istream &stream, Dictionary &ob)
  34. {
  35. cout << "Enter the name of your new dictionary:"<<endl;
  36. stream >> ob.name;
  37. }
  38.  
  39. void Dictionary::greate()
  40. {
  41. cout<<"Enter name of your new dictionary"<<endl;
  42. cin>>name;
  43. }
  44.  
  45. void Dictionary::show()
  46. {
  47. cout<<"Your Dictionaries:"<<endl;
  48. cout<<name<<":"<<endl;
  49. }
  50.  
  51. void Dictionary::search()
  52. {
  53.  
  54. }
  55.  
  56. int main()
  57. {
  58. char ch;
  59. Dictionary d("First");
  60. Dictionary a("Second");
  61. Dictionary b("Third");
  62. for(;;)
  63. {
  64. cout<<"Menu:n";
  65. cout<<"1.Greate new dictionaryn";
  66. cout<<"2.Show dictionariesn";
  67. cout<<"3.Exitn";
  68. cout<<"Your choise: ";
  69. cin>>ch;
  70. switch(ch)
  71. {
  72. case '1':a.greate();break;
  73. case '2':a.show(); break;
  74. case '3':exit(0);
  75. }
  76. }
  77. return 0;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement