GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Consider the following code segment. String one = “computer”…

Consider the following code segment. String one = “computer”; String two = “science”;String concat = /* missing code */; System.out.println(concat); Which of the following expressions can be used to replace /* missing code */ so that the code segment prints the string “pun”?

Read Details

What occurs when an integer expression evaluates to a value…

What occurs when an integer expression evaluates to a value outside the allowed range?

Read Details

Users of a mobile application are categorized based on the a…

Users of a mobile application are categorized based on the average number of hours they use the application each day, as shown in the following table.   Mobile Number Users Category Average Hours of Use Per Day Top User Greater than 5 Regular User Between 1 and 5, inclusive Inactive User Less than 1     Suppose n is the average number of hours a user spends using the application each day. Which of the following algorithms can be used to assign the correct categorization to a user?

Read Details

Consider the following code segment, which is intended to pr…

Consider the following code segment, which is intended to print true only when both r and v are positive numbers. Assume that r and v have been properly declared and initialized.   boolean rPos = r > 0; boolean vPos = v > 0;System.out.print(rPos == vPos);    The code segment does not always work as intended.   Which of the following values for r and v will demonstrate that this code segment does not work as intended?

Read Details

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

Posts pagination

Newer posts 1 … 49 50 51 52 53 … 86,441 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top