ZyBooks: 2.4.1: Enter the output of the integer expressions.

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 3K views
zbandicoot1491
Messages
1
Reaction score
0
I'm not sure how to do these problems here. Help me learn them please!
View attachment 7289
 
Attachments
  • Capture.PNG
    Capture.PNG
    13.6 KB · Views: 153
Physics news on Phys.org
Okay, let's go through it step by step. Initially, x is set to 3 and y is set to 0. Now, do you understand what the command "y= (2*(x+ 3))+ 6" means? What will x and y be after that is executed?

Then what would "system.out.print(x)" do? What about "system.out.print(y)". So what about "System.out.print(x+ " "+ y)?