Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include "iostream"
  2. #include <queue>
  3. #include <string>
  4. using namespace std;
  5. class Ticket{
  6. public:
  7. string name;
  8. string ID;
  9. unsigned int birthyear;
  10. Ticket(string new_name, string new_ID, unsigned int new_birthyear)
  11. {
  12. name = new_name;
  13. ID = new_ID;
  14. birthyear = new_birthyear;
  15. }
  16. };
  17. queue<Ticket> Waiting_list;
  18. void add_new_waiting(string new_name, string new_ID, unsigned int new_birthyear);
  19. Ticket get_front();
  20. int main()
  21. {
  22. add_new_waiting("NGUYEN VAN A", "0010", 1990);
  23. cout << get_front().name<<'\n';
  24. cout << get_front().ID << '\n';
  25. cout << get_front().birthyear << '\n';
  26. }
  27. void add_new_waiting(string new_name, string new_ID, unsigned int new_birthyear)
  28. {
  29. Ticket new_person(new_name, new_ID, new_birthyear);
  30. Waiting_list.push(new_person);
  31. }
  32. Ticket get_front()
  33. {
  34. return Waiting_list.front();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement