Inf1 OP : Lab Sheet Week 2 Q2 - Largest Double
Overview

In this question, you will write a program that reads two floating-point numbers from the command line and returns the larger of the two. By default, a floating point number in Java is of type double, and this is the type we will use here.

When we took in arguments of type int from the command line in previously, we had to convert them from strings using Integer.parseInt(). Analogously, we will use the method Double.parseDouble() to convert a String into double .

Write your program to perform the required functionality. Your class should be called LargestDouble. Your session at the terminal should something like this:

: javac LargestDouble.java
: java LargestDouble 34.3 23.2
34.3
: java LargestDouble 45.1 45.2
45.2

Note

To print out a double, you can still the use the function System.out.println()

Note

You program may display many more numbers past the decimal point in the output, but don’t worry about that at this stage.

An automated test has been created for this exercise: LargestDoubleTest.java.