Guest User

Untitled

a guest
Jan 16th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. template <class Type,int p>
  2. class Collection
  3. {
  4. private:
  5. Type* niz;
  6. int n;//added this just in case
  7. public:
  8. Collection();
  9. ~Collection();
  10. bool Find(Type t);//checks if the t is in the array with operator!=
  11. void Arrange();//arranges the array
  12. void Reverse();//swithces the first memmber of array to the last and the second to p-2
  13. void Set(int i,Type t);//should set t to the niz[i]
  14. void SaveElement(int i, char* Dat);//this is for saving in a file
  15. void ReedElement(char*Dat);//this is for printing on the screan from a file
  16. //bool operator!=(Type& t,Type& a);//visual studio is telling me 2 many arguments,dont know why
  17.  
  18. };
  19. class Hotel
  20. {
  21. private:
  22. char*HotelName;
  23. int numRooms, openedYear,catagoryHotel;
  24. public:
  25. Hotel();
  26. ~Hotel();
  27. void SetHotel();
  28. //bool operator <=(Hotel& h1, Hotel& h2);this for some reason doesnt work also
  29. };
  30. //In my constructor for Collection i typed
  31. template<class Type, int p>
  32. inline Collection<Type, p>::Collection()
  33. {
  34. n = p;
  35. niz = new Type[n];
  36.  
  37. }
  38. //in the constructor for Hotel() i typed
  39. Hotel::Hotel()
  40. {
  41. HotelName = "Undenfined";
  42. catagoryHotel = 0;//how much stars it has
  43. openedyear = 0;
  44. numRooms = 0;
  45. }
Add Comment
Please, Sign In to add comment