Answer to Question #240691 in Java | JSP | JSF for Nguu

Question #240691

Given Create a program that when run with a name, an integer and a double as CMD arguments, it prints out a greeting using the name and also print the difference of the two given numbers: Sample run 1:  



1
Expert's answer
2021-09-22T23:44:54-0400
public class Main {
    public static void main(String[] args) {
        String name = args[0];
        int intNumber = Integer.parseInt(args[1]);
        double doubleNumber = Double.parseDouble(args[2]);

        double difference = intNumber - doubleNumber;

        System.out.println("Hello " + name);
        System.out.println("Difference: " + difference);
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS