Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Command == "PRINT"){
- File.open("file.txt", std::ios::in);
- while (!File.eof()) {
- Train train_to_print;
- File >> train_to_print;
- PrintTrain(std::cout, train_to_print);
- std::cout << std::endl;
- }
- File.close();
- }
- std::istream& operator>>(std::istream& is, Train& train){
- int Data_ID, Number;
- std::string Name, Type;
- Date Departure_Date, Arrival_Date;
- Time Departure_Time, Arrival_Time;
- double Popularity_Rate;
- is >> Data_ID >> Name >> Number >> Type
- >> Departure_Date >> Departure_Time
- >> Arrival_Date >> Arrival_Time >> Popularity_Rate;
- train = Train(Data_ID,Name,Number,Type,Departure_Date,Departure_Time,Arrival_Date,Arrival_Time,Popularity_Rate);
- return is;
- }
- std::istream& operator>>(std::istream& is, Time& time){
- int mins, hours;
- std::cin >> hours >> mins;
- time = Time(hours,mins);
- return is;
- }
- std::istream& operator>>(std::istream& is, Date& date){
- int day, month, year;
- std::cin >> day >> month >> year;
- date = Date(day,month,year);
- return is;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement