GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

In the following code segment, n is a properly declared and…

In the following code segment, n is a properly declared and initialized int variable.     boolean result = false; if (n >= 10){ result = true;}if (n

Read Details

Consider the following code segment.   for (int m = 16; m >…

Consider the following code segment.   for (int m = 16; m > 0; m -= 2){ if ((m % 3) == 1) { System.out.print(m + ” “); }}   What is printed as a result of executing this code segment?

Read Details

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

What is the output of the following code segment?   for (int k = 5;  k > -5; k–){  System.out.print( k + ” ” );}System.out.println( );

Read Details

A certain device requires a passcode to be used. The passcod…

A certain device requires a passcode to be used. The passcode must meet both of the following requirements.   • The passcode must be 4 digits long. • The passcode must not start with a zero (0) digit.   Assume that pass is a properly declared and initialized int variable.   Which of the following expressions will evaluate to true if pass is an acceptable passcode?

Read Details

What is the difference between a runtime error and an except…

What is the difference between a runtime error and an exception?

Read Details

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

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

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

Posts pagination

Newer posts 1 … 882 883 884 885 886 … 87,273 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top