Question: In Java, 1. Write an if statement that assigns 20 to the variable y and assigns 40 to the variable z if the variable x

In Java,

1. Write an if statement that assigns 20 to the variable y and assigns 40 to the variable z if the variable x is greater than 100.

2. Write code that tests the variable x to determine whether it is greater than 0. If x is greater than 0, the code should test the variable y to determine whether it is less than 20. If y is less than 20, the code should assign 1 to the variable z. If y is not less than 20, the code should assign 0 to the variable z.

If you could do it repl.it. that would be amazing!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!