Write Program Called Math Takes Input Two Strings Command Line Args 0 Args 1 B Convert Tw Q37299101

Write A Program called Matha. Takes as input two Strings from the Command Line args[0],args[1]b. Convert these two strings to doubles.c. Add them together.d. If the second number is no-Zero divide them.e. Report on the results.


Answer


public class Math { public static void main(String[] args) { if (args.length == 2) { double n1 = Double.parseDouble(args[0]); double n2 = Double.parseDouble(args[1]);

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.