Create a program that when run with two numbers as CMD arguments, it prints out the difference
and product separated by space[Hint: CMD arguments need to be converted to integers]:
Sample run 1: Sample run 2:
java lab02_task02 12 3 java lab02_task02 2 5
Output: 9 36 Output: -3 10
1
Expert's answer
2021-09-14T07:35:51-0400
public class lab02_task02 {
public static void main(String[] args) {
int x = Integer.parseInt(args[0]);
int y = Integer.parseInt(args[1]);
System.out.println(x - y + " " + x * y);
}
}
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment