GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

What is the output of the following code segment?   for (int…

What is the output of the following code segment?   for (int k = 0;  k

Read Details

Consider the following two code segments, which are intended…

Consider the following two code segments, which are intended to produce identical outputs.   Code Segment 1   for (int i = 0; i < 10; i++){ System.out.println("counting " + i);}   Code Segment 2   int x = 0; while (x < 10){ x = x + 1; System.out.println("counting " + x);}   Which of the following changes can be made to Code Segment 2 so that the outputs of the two code segments are identical as intended?

Read Details

Consider the following method. public static String scramble…

Consider the following method. public static String scramble(String word, int howFar) { return word.substring(howFar + 1, word.length()) + word.substring(0, howFar); } What value is returned as a result of the call scramble(“compiler”, 3)? (Copyright AP College 2014-30)

Read Details

A Boolean expression evaluates to either true or false.

A Boolean expression evaluates to either true or false.

Read Details

What is the result of 17 % 5 when evaluated in a Java expr…

What is the result of 17 % 5 when evaluated in a Java expression? If it shows an error, just type ‘error.’

Read Details

A student has created a Person class. The class contains var…

A student has created a Person class. The class contains variables to represent the following: A String variable called name to represent the name of a Person object An int variable called age to represent the age of a Person object A String variable called gender to represent the gender of a Person object The object is declared as type Person and has the reference variable p1. Which of the following descriptions is accurate?

Read Details

Consider the following code segment. int num = 0;for (int i…

Consider the following code segment. int num = 0;for (int i = 0; i < 100; i++) {         num+=2;}System.out.println(num); What would be the output?

Read Details

Consider the code segment below. int a = 1988;int b = 1990;S…

Consider the code segment below. int a = 1988;int b = 1990;String claim = ” that the world’s athletes ” + “competed in Olympic Games in “;String s = “It is ” + true + claim + a + ” but ” + false + claim + b + “.”;System.out.println(s); What, if anything, is printed when the code segment is executed? (Copyright AP College Board)

Read Details

When would you use the modulus operator %?

When would you use the modulus operator %?

Read Details

The term “algorithm” comes from the name of which historical…

The term “algorithm” comes from the name of which historical figure?

Read Details

Posts pagination

Newer posts 1 … 41 42 43 44 45 … 86,435 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top