Which method should I use ?

Posted by Ivan on Stack Overflow See other posts from Stack Overflow or by Ivan
Published on 2010-03-20T06:29:21Z Indexed on 2010/03/20 6:31 UTC
Read the original article Hit count: 320

Filed under:
|
|
|

I want to do this exercise but I don't know exactly which method should I use for an exercise like this and what data will I use to test the algorithm.

The driving distance between Perth and Adelaide is 1996 miles. On the average, the fuel consumption of a 2.0 litre 4 cylinder car is 8 litres per 100 kilometres. The fuel tank capacity of such a car is 60 litres. Design and implement a JAVA program that prompts for the fuel consumption and fuel tank capacity of the aforementioned car. The program then displays the minimum number of times the car’s fuel tank has to be filled up to drive from Perth to Adelaide. Note that 62 miles is equal to 100 kilometres.

What data will you use to test that your algorithm works correctly?

© Stack Overflow or respective owner

Related posts about exercise

Related posts about homework