diff --git a/station_finder.cpp b/station_finder.cpp index 3fde8fe..dedad49 100644 --- a/station_finder.cpp +++ b/station_finder.cpp @@ -3,6 +3,7 @@ #include #include #include +#include // to get system local date and time using namespace std; @@ -151,6 +152,7 @@ class metroline cout<50) ? (50) : (no_of_stations*15); + cout<<"\n Booking Date and Time : "<< dt << endl; // booking date and time printing } else { @@ -159,7 +161,8 @@ class metroline cout<<"\n\nEnding Station: "; cout<50) ? (50) : (-no_of_stations*15);; + cout<<"\nYour total fare will be Rs. "<<(((-no_of_stations)*15)>50) ? (50) : (-no_of_stations*15); + cout<<"\n Booking Date and Time : "<< dt << endl; // booking date and time printing } } }; @@ -167,6 +170,9 @@ class metroline int main() { clrscr(); + time_t now = time(0); // for date and time + char* dt = ctime(&now); + metroline red("red"),yellow("yellow"); int choice,ch; char char_choice; @@ -256,4 +262,4 @@ int main() } while(char_choice == 'y' || char_choice == 'Y'); return 0; -} \ No newline at end of file +}