GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Which of the following will cause a compile error?

Which of the following will cause a compile error?

Read Details

Which of the following is NOT typically a feature of an IDE?

Which of the following is NOT typically a feature of an IDE?

Read Details

A store sells rope only in whole-foot increments. Given thre…

A store sells rope only in whole-foot increments. Given three lengths of rope, in feet, the following code segment is intended to display the minimum length of rope, in feet, that must be purchased so that the rope is long enough to be cut into the three lengths.   For example, for lengths of 2.8 feet, 3 feet, and 5 feet, the minimum length of rope that must be purchased is 11 feet. For these values, the code segment should display 11. As another example, for lengths of 1.1 feet, 3.2 feet, and 2 feet, the minimum length of rope that must be purchased is 7 feet. For these values, the code segment should display 7.   In the following code segment, len1, len2, and len3 are properly declared and initialized double variables representing the three lengths of rope.   double total = len1 + len2 + len3; int minLength = (int) (total + 0.5); System.out.print(minLength);   Which of the following best describes the behavior of the code segment?

Read Details

What is the largest possible value for an int in Java?

What is the largest possible value for an int in Java?

Read Details

If x has the value 6, Java will only evaluate the left side…

If x has the value 6, Java will only evaluate the left side of the compound expression in the if condition: if (x > 1 && x < 50) 

Read Details

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

Consider the following code segment. int value = initValue;if(value > 10){ if(value > 15){ 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

Consider the following code segment. String str = “0”;str +=…

Consider the following code segment. String str = “0”;str += str + 0 + 8;System.out.println(str); What is printed as a result of executing the code segment? (Copyright AP College Board)

Read Details

Consider the following code segment. import java.util.Scanne…

Consider the following code segment. import java.util.Scanner; public class Test {     public static void main(String[] args) {          Scanner input = new Scanner(System.in);            System.out.println(“Enter your name:” );           String name = input.nextLine();           System.out.print(“Hello, ” name);      }} What will be the output if the user enters Jack?

Read Details

What is the value of true && false?

What is the value of true && false?

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

Posts pagination

Newer posts 1 … 46 47 48 49 50 … 86,437 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top