Question: You just started working as a sailor aboard an interstellar trading vessel, aspiring to learn the ropes so that you may one day operate your

 You just started working as a sailor aboard an interstellar trading
vessel, aspiring to learn the ropes so that you may one day
operate your own trading vessel. Interstellar trading is not the only thing

You just started working as a sailor aboard an interstellar trading vessel, aspiring to learn the ropes so that you may one day operate your own trading vessel. Interstellar trading is not the only thing new to you, the captain belongs to an alien species you have never encountered before. Notably he has seven fingers on his right-hand and strongly opinionated about anything number related. As the newest member of the crew it is your job to make sure that the number of units of free cargo space on the ship is divisible by seven. Nervous yet excited you go down to the cargo hold before the initial departure. Sure enough the number of units of free space is divisible by seven and you are determined to keep it that way. The first stop during your trading route is Acamar III. The captain buys a large quantity of parthas, equal to six sevenths of the empty space remaining in the hold. After loading the cargo you notice that the remaining units of free space is not divisible by seven, but has a remainder of six. Horrified, you buy six units of Spock action figures so that the remaining space is divisible by seven. The second stop is Bajor, where the captain buys foraiga equal to five sevenths of the empty space. Once again, after loading the cargo you notice that the remaining number of units of free space is not divisible by seven, but has a remainder of five. You buy five units of Spock action figures so that the remaining space is divisible by seven. At the third stop you load units of cargo equal to four sevenths of the remaining empty space, but have to buy four units of Spock actions figures so that the remaining space is divisible by seven. This repeats for the fourth, fifth, and sixth stops, until the seventh stop at Vulcan where the captain sells his wares and you profit handsomely off the Spock action figures you sell. How many units of empty cargo space was there when you began your journey? Write an imperative program and a functional program to answer the above question, "How many units of empty cargo space was there when you began your journey?" There are infinitely many possible starting units. Your programs will search through a range of numbers (including both endpoints of the range) and output a list of solutions. The programs should use the following parameters: - Start of range of integers a(a>=1). - End of range of integers b(b>=a). - Captain's favorite number (3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!