A spaceship has to travel a distance of 1500 miles away from earth. The spaceship can only travel 220 miles before it needs to refuel. It is fueled before it leaves earth and there are several fueling stations along the way. Read data from a file where the end of data is indicatded by a distance of 0 as follows:
Another set of sample data could be:
the program should output to the user whether or not the journey is possible. For the 1st set of sample data, the journey is not possible but it is possible for the second set.
Can someone tell me how to go about doing this please.