1. Which of the following expression evaluates to a value of 15?

1+2x3+4
(1+2)x(3+4)
1+2x(3+4)
(1+2)x3+4**
2. If x is an int which of the following statements adds 5 to the current value of x and store the new value back in x?
x=5;
x+5; **
x =+ 5;
x += 5;
3. If x is an int which of the following statements increments x by 1?
x = 1;
x+;
x++;
x + 1 = x; **
4. If d is a double variable with a value of 7.5 which of the following statements results in a value of 7 being assigned to x?
int x = (int)d;
int x = d;
int x = int(d); **
double x = d;
5. If the Unicode value for the letter A is 0041. Which of the following statements correctly assigns the value 'A' to char variable n?
char n = 41;
char n = '\u0041 ' ; **
char n = '0041';
char n = A;
Is this all correct? If not can you tell me how I am wrong? Thank you

1 answer

If you're using java, ya gotta stop using "x" for multiplication. Use "*".

#1. Nope
(1+2)*3+4 = 3*3+4 = 9+4 = 13

#2 Nope
x+5 is just an expression which yields the sum of x and 5. It does not update the value of x.

#3 Nope
x+1 = x is invalid syntax. Try it in your java compiler.

#4 Nope
int(d) is invalid. You want to change the type of d, not call a function named "int". Try it out and you will get an error message.

#5 ok
Similar Questions
  1. What does a specific rubric evaluate?It evaluates the way a writer proofreads and edits a paper. It evaluates the way in which
    1. answers icon 1 answer
  2. What does a specific rubric evaluate?It evaluates the way in which an instructor grades a paper. It evaluates the way a writer
    1. answers icon 3 answers
  3. What does a general rubric evaluate?It evaluates specific criteria for a specific type of writing. It evaluates the way a writer
    1. answers icon 1 answer
    1. answers icon 1 answer
more similar questions