Let's make the computer count for us! Ultimately, that's what they were created for. In this task, we ask the computer to calculate the sum and product of two numbers. Everything is super simple: we declare int variables, assign them a value, add and multiply them, and then display the result.
Part of a calculator
You must be signed in to leave a comment
31 January, 00:56
prestar atención al ejemplo donde explica las condiciones de la tarea
19 April 2021, 03:16
Can someone help me guide what I'm missing here?
19 April 2021, 05:09
Please post your question with the attached solution in the section Help.
8 May 2020, 21:46
Every single time I hit "code analysis" it says: Comments on code style were not found. I've added comments to every line of code. Anyone else having this problem? Not sure what is expected for comments. Any ideas?
12 May 2020, 06:31
"code analysis" wants Java Documentation Comment (Javadoc)
12 May 2020, 21:34
I only know these two. // and /* comment here */ otherwise, I don't know what Javadoc is.
29 January 2020, 20:03
I hate the fact that I forgot what "Product" meant. I am in my 30's...Needless to say, I failed 3 times in a row on this one before getting it. lol Good luck!
18 December 2019, 14:06
I am not passing because of this: The program should have two int variables a and b. I have two int variables a and b and immediately assigned them values. What is wrong?
18 December 2019, 14:08
Nevermind, I realized what I did from the help section.
4 October 2019, 22:23
By highlighting the sum and product in blue, it leads you to believe you should be using methods for the calculation, when this is not the case.
6 November 2019, 22:05
You can do it though, it works. In fact, they probably want us to create methods for practice.
30 September 2019, 08:59
The key is in the system output ;)
12 June 2019, 20:07
Unable to solve this code. plz help me out
18 June 2019, 10:30
Hi Harshit, I spent a lot of time in this also. But the code is actually pretty easy, in fact you only use 'public void main' (the main method)- my mistake was in thinking you actually need another two methods for Sum and product, but no, everything goes in the main method...Hope that helps! Asanga
8 May 2020, 21:43
In the System.out.println(a+b) Do the same thing to get the product, but on another line.
19 January 2019, 00:51
Integer.sum() or + Don't create variables for sum and product.
24 December 2018, 05:54