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:
912
510
400
0
Another set of sample data could be:
1280
720
900
1400
500
200
360
1100
0
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.