+ 1
Can anyone tell me were to find the information for question 2 of the primative operations. Core concepts, java tutorial.
4 Answers
+ 3
Comment to each quiz is at lower left, not upper right.
https://www.sololearn.com/post/131750/?ref=app
+ 1
Well the question is looking for the sum of two variables in which it wants that sum to be displayed to the screen.
We know that:
int x = 2;
int y = 4;
So, how do we get the sum of those two numbers? well we add them. As dicussed in the lesson prior to that question, we can use the â+â operator to add two values together.
Since we know x contains the value 2 and y contains the value 4, then x+y would be the same as saying 2+4 in which either would result in the sum of 6. (However we favor the former, because why create two variables if we arent going to use them?)
Now, in order to display the sum of our addition, we would need to output it to the console (the sum of which is being stored in the variable named result) we learned in the âhello worldâ lesson that we can display something to the screen by using System.out.println(argument) and the value(or variable) we put within those two parantheses in place of âargumentâ is what will be displayed to the screen such as if you were to replace argument with âhello worldâ, then when the program is ran, âhello worldâ would be displayed on the screen. So if we wanted to display the result of our addition, what would we put between those two parantheses in place of argument?
0
Did you try checking the comments on the question?
0
I cannot find comments for the question, only the information sections.