Desert crossing solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (1 vote)

You are planning to cross a desert 2413 km wide in a special desert vehicle.
• The vehicle can travel 12 km on 1 litre of fuel.
• It has a 60 litre tank and can carry at most four 20 litre cans.
• The only source of fuel and cans is at the base at the start of the desert. Fuel and
cans at the base are not limited.
Task
Write a report giving your answers to the following:
1. Using the vehicle without refuelling, how far into the desert can you safely go?
2. Describe a procedure whereby you could cross the desert in the vehicle.
3. Describe a procedure whereby you could cross the desert and return in the vehicle.
4. Describe a procedure whereby you could cross the desert in the vehicle using the
minimum amount of fuel.
5. Describe a procedure whereby you could cross the desert and return in the vehicle
using the minimum amount of fuel.
The procedures must each be in their own file (submitted with the report) in the format
given below. Your report should include a discussion of your procedures (which may
include, but does not have to include, a program or the results of simulation). The
format for a procedure file is:
• The first line is treated as a title and is not processed.
• Each subsequent line (ended by a newline) represents one trip into the desert. It
is encoded by a sequence of character/number pairs which mean the following:
• T23.4 – pick up 23.4 litres and put them into the tank
• C23.4 – load cans containing 23.4 litres onto the back of the truck (note that the
program keeps track of how many cans you have on the truck)
• F23.4 – drive forward (towards the end of the desert) 23.4 kilometres
• D23.4 – dump cans containing 23.4 litres at the current position in the desert
• B23.4 – drive backwards (towards the base) 23.4 kilometres
• *3 (… …) – repeat the two commands in brackets (i.e. T/C/F/D/B) 3 times
COSC 326 2017 Semester 2 Étude 4
• The last line (which must have a newline) should follow this format
#1500.0
which indicates that you used (for example) 1500 litres in total.
There is a checking program linked from the web page that will do basic tests on your
procedure. You should not submit a procedure that does not pass the checking program
(it is set up for the final task / return trip so on one way trips it will say that you failed
to return, don’t worry about that). We will be doing further checking / analysis in
marking.
(3 point, Group)