The following program takes two numbers as input from the user when run and is supposed to add those numbers together and print the result. I am compiling and then running the program like so:> javac...

The following program takes two numbers as input from the user when run and is supposed to add those numbers together and print the result. I am compiling and then running the program like so: > javac Example.java > java Example 5,3 There are two problems. One line of code needs changed and the way I'm running the code needs changed. What are those changes? public class Example { public static void main(String[] args) { int result = addValues(args); System.out.println("The sum of your numbers is: "+result); } public static int addValues(String x, String y) { int tempx = Integer.parseInt(x); int tempy = Integer.parseInt(y); return tempx + tempy; } }

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here