Java if else questions with int
So i got this assignment from class here a few example problems-

What is the vaule of x and y (if used) after the code below executes:


    int x=0;
    if (false) x=1; else x = 2;

Answer: x=

    boolean x = false;
    int y =0;
    if (x=true) y = 1; else y = 2;

Answer:x =  and y=

    int x = 0;
    switch (2) {
    case 1: x +=1;
    case 2: x += 2;
    case 4 x += 4;



Answer:x =

    int x=0;
    if (1 > 0)
    if (1>2) x=1;
    else x=2;`

Answer: x= 

    int x=1;
    while (x<3) x += x;


Answer: x=

    int x = 0;
    for (int i =0; i<100; i ++ {
    x =+ 10;



Answer: x= 

I feel like some of these problems require user input, but I don't know kinda new at this stuff. If not can you please explain how you got the answer?

Thanks so much for your help I really appreciate it.
Java if else questions with int
===

So i got this assignment from class here a few example problems-

What is the vaule of x and y (if used) after the code below executes:


    int x=0;
    if (false) x=1; else x = 2;

Answer: x=

    boolean x = false;
    int y =0;
    if (x=true) y = 1; else y = 2;

Answer:x =  and y=

    int x = 0;
    switch (2) {
    case 1: x +=1;
    case 2: x += 2;
    case 4 x += 4;



Answer:x =

    int x=0;
    if (1 > 0)
    if (1>2) x=1;
    else x=2;`

Answer: x= 

    int x=1;
    while (x<3) x += x;


Answer: x=

    int x = 0;
    for (int i =0; i<100; i ++ {
    x =+ 10;



Answer: x= 

I feel like some of these problems require user input, but I don't know kinda new at this stuff. If not can you please explain how you got the answer?

Thanks so much for your help I really appreciate it.