Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. #include "iostream"
  2. using namespace std;
  3.  
  4. class Bus
  5. {
  6. public:
  7. void fillData(); //ввод данных
  8. void showData(); //ввывод данных
  9. private:
  10. char start[32]; // название начального пункта маршрута
  11. char end[32]; // название конечного пункта маршрута
  12. char bus[32]; // номер маршрута
  13. };
  14. int main()
  15. {
  16. setlocale(LC_ALL, "rus");
  17.  
  18. Bus first;
  19. Bus second;
  20. Bus Third;
  21. Bus fourth;
  22. Bus fith;
  23.  
  24. cout << "Внесите данные\n";
  25.  
  26. first.fillData();
  27. second.fillData();
  28. Third.fillData();
  29. fourth.fillData();
  30. fith.fillData();
  31.  
  32. first.showData();
  33. second.showData();
  34. Third.showData();
  35. fourth.showData();
  36. fith.showData();
  37. return 0;
  38. }
  39. void Bus::fillData()
  40. {
  41. cout << "название начального пункта маршрута: ";
  42. cin.getline(start, 32);
  43. cout << "название конечного пункта маршрута: ";
  44. cin.getline(end, 32);
  45. cout << "номер маршрута: ";
  46. cin.getline(bus, 32);
  47. }
  48. void Bus::showData()
  49. {
  50. cout << "название начального пункта маршрута: " << start <<"название конечного пункта маршрута: " << end << "номер маршрута: " << bus << endl;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement