GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

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

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

Consider the following code segment. int count = 0;for (int k = 0; k < 10; k++){count++;}System.out.println(count); Which of the following code segments will produce the same output as the code segment above?

Read Details

Consider the following code segment. double a = 7;int b = (i…

Consider the following code segment. double a = 7;int b = (int) (a / 2); double c = (double) b / 2; System.out.print(b); System.out.print(” “); System.out.print(c); What is printed as a result of executing the code segment?

Read Details

If an int variable weight currently holds the value 150, wha…

If an int variable weight currently holds the value 150, what is its value after the following statement is executed?         weight -= 27; If it shows an error, just type ‘error.’

Read Details

The AnimalPrinter class includes the following two methods….

The AnimalPrinter class includes the following two methods. AnimalPrinter Class Method Signature Explanation public void printDog() Prints the word “dog” and then moves the cursor to a new line. public void printCat() Prints the word “cat” and then moves the cursor to a new line. The method myMethod appears in a class other than AnimalPrinter. The method is intended to produce the following output. dog cat Assume that an AnimalPrinter object myPrinter has been properly declared and initialized inside myMethod. Which of the following code segments, if located in myMethod, will produce the intended output?

Read Details

Posts pagination

Newer posts 1 … 66 67 68 69 70 … 86,459 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top