Practice displaying stuff
Comments (114)
- Popular
- New
- Old
You must be signed in to leave a comment
Anonymous #11263139
27 January 2023, 19:38
Remember the order of operations:
1. ( )
2. ^
3. *, / from left to right
4. +, - from left to right
PEMDAS is an acronym used to mention the order of operations to be followed while solving expressions having multiple operations.
PEMDAS stands for
P- Parentheses,
E- Exponents,
M- Multiplication,
D- Division,
A- Addition, and
S- Subtraction.
0
Anonymous #11263139
27 January 2023, 19:31
0
hidden #11206029
24 December 2022, 16:18
No encuentro otra manera System.out.println(2 * (3 + 4 * (5 + (6 * 7))));
0
ValPereira
1 November 2022, 20:10
Muitas coisas estão sendo pedidas em tarefas que ainda não aprendemos por exemplo: for, enfim
+1
Anonymous #11047028
7 August 2022, 11:18
wasn't so easy to understand the 4 parenthesis but when understand it's easy!
0
Anonymous #10912898
7 January 2022, 15:14
括号脑筋急转弯答案:System.out.println(2 * (3+4 *( 5 + 6 * 7)));
想不到吧😂😂😂
+1
Figueroa Gabriel Hernan
21 September 2021, 21:54
El ejercicio Parenthetical brainteaser fue muy dificil pero lo puede hacer!! en un momento creí que no había forma de llegar a 382. Excelente ejercicio.
+1
Mike Bayley
20 July 2021, 19:18
I've just noticed something...when using IntelliJ normally, I see the output of running the program in the terminal below, but this does not happen when running the CodeGym exercises. It tells me if the program is correct or not, but I don't see the output?
0
Anonymous #10754849
28 July 2021, 13:40
That's why it's better to use intellij as you can see the result before verifying.
0
0wis
12 August 2021, 13:55
You can use the "run" button between "discuss" and "code analysis" in the browser to see the output without verfiying.
+1
Justin Smith
4 July 2021, 16:32
For the Parenthetical Brainteaser, I am not sure if it matters (I have yet to find the solution after several hours), but after googling something I was unsure about, there may be an important piece of information not listed in any of the lessons up to this point. Java will follow the order of operations in mathematical expressions.
In other words, if you have 2 + 4 * 7, Java will evaluate 4 * 7 first and arrive at an answer of 30, rather than 42. Parentheses aren't necessary if 30 is the desired result. So the solution to this may involve not needing to put parentheses around a multiplied part because it's automatically going to be done first.
I wish I had googled this first, because I've already spent the first 4 hours of this task assuming it was just strict left-to-right evaluation except for parentheses.
0
Anonymous #10752052
23 June 2021, 23:47
I like this!!
0