GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Which assignment operator would you use to add 5 to a variab…

Which assignment operator would you use to add 5 to a variable x?

Read Details

x and y are declared as integer variables.You are given the…

x and y are declared as integer variables.You are given the following expression: x >= y Which of these expressions is the opposite of the above expression and has valid syntax?

Read Details

Consider the following code segment.    boolean a = true;boo…

Consider the following code segment.    boolean a = true;boolean b = false;boolean temp = a:a = b;b = temp;System.out.println(a);System.out.println(b);   What is printed as a result of executing this code segment?

Read Details

Assuming the following declarations:  int x = 5, y = 2, z =…

Assuming the following declarations:  int x = 5, y = 2, z = 10, temp = 0; What is the output of the following statement? If it causes an error, just type error. If nothing is output, just type no output. if ( y >= x ) {    y = z;    System.out.println( x + ” ” + y + ” ” +  z );

Read Details

Assume that you are given the following declarations: int nu…

Assume that you are given the following declarations: int num = 0;double val = 0.0;num = 2 % 6 / 2 – 4; Show the value that will be stored in the variable on the left. If the expression causes an error, just type ‘error.’

Read Details

Consider the following code segment. int value = initValue;i…

Consider the following code segment. int value = initValue;if(value > 7) { if(value < 22) { value = 0; }}else { value = 1;}System.out.println(“value = “ + value); Under which of the conditions below will this code segment print value = 1?

Read Details

Which statement generates random numbers in the range from 1…

Which statement generates random numbers in the range from 10 to 50?

Read Details

What will be printed after the following statements are exec…

What will be printed after the following statements are executed? int length;length = 11; // 11length *= 3; length *= length;length /= 50;System.out.println(length); If it shows an error, just type error.

Read Details

Consider the following code segment.       int a = 10;    in…

Consider the following code segment.       int a = 10;    int b = 5;    if(a + b > 10) {        System.out.print(a + b);    }    if(a – b > 0) {         System.out.print(a – b);    }   What, if anything, is printed as a result of executing the code segment?

Read Details

What would be the output of the following code? int input =…

What would be the output of the following code? int input = 5;int output = 3;input++;output += input;System.out.println(output);

Read Details

Posts pagination

Newer posts 1 … 884 885 886 887 888 … 87,273 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top