Imagine you are a Go developer at a time travel agency and need to create a program that schedules time travel trips for clients. Each trip has three time points: departure date, historical event date, and return date. However, the program must validate if the trip is valid based on the following rules:
The
historicalEventDatemust be in the past relative to thedepartureDate.The
returnDatemust be in the future relative to thedepartureDate.All travels are only to the past!
Your task is to write the additional required code for the readDate() function to create a Date object from the input dates, and the code for the conditional statements to check if the trip is valid.
If the trip is valid, your program should print "Valid trip!" and if the trip is not valid it should print "Invalid trip!".