GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

 \\               =o)  (o>               /\\ _(()__Short Cod…

 \\               =o)  (o>               /\\ _(()__Short Coding__\_V_ //                 \\                     \\

Read Details

 \\             =o)  (o>           /\\ _(()__Modifiers__\_V_…

 \\             =o)  (o>           /\\ _(()__Modifiers__\_V_ //             \\                \\  

Read Details

 \\               =o)  (o>               /\\ _(()__Feedback…

 \\               =o)  (o>               /\\ _(()__Feedback & Scratch__\_V_ //                 \\                      \\  

Read Details

You have a file Ghost.java and you have a driver class named…

You have a file Ghost.java and you have a driver class named Driver.java. Fill in the correct visibility modifiers so that the comments in the main method are upheld.  public class Driver {     public static void main(String[] args) {         Ghost t = new Ghost();         // each of the lines below is run independently        System.out.println(t.age);    // compiles and runs        System.out.println(t.getPower()); // compile error        System.out.println(t.power); // compiles and runs     } }  —— in a separate file in a different package/directory ———  public class Ghost {        1   int age;       2   int power;       3   int getPower() {        return power;     }     /** no-argument constructor implemented **/ }    1  :[vis1]   2  :[vis2]   3  :[vis3]

Read Details

Given the following code, what is the value of b?   String x…

Given the following code, what is the value of b?   String x = “BROCCOLI”; String y = x; x.toUpperCase(); boolean b = (y.equals(x)); 

Read Details

You have a file State.java and you have a driver class named…

You have a file State.java and you have a driver class named Driver.java. Fill in the correct visibility modifiers so that the comments in the main method are upheld.  public class Driver {     public static void main(String[] args) {         State t = new State();         // each of the lines below is run independently        System.out.println(t.getAveragePopulation()); // compile error System.out.println(t.averagePopulation); // compiles and run System.out.println(t.numCounties);    // compiles and runs     } }  —— in a separate file in a different package/directory ———  public class State {        1   int numCounties;       2   double averagePopulation;       3   double getAveragePopulation() {        return averagePopulation;     }     /** no-argument constructor implemented **/ }    1  :[vis1]   2  :[vis2]   3  :[vis3]

Read Details

Write 2-3 lines of code to:  Declare a String variable and…

Write 2-3 lines of code to:  Declare a String variable and save your favorite animal in it. Print the value of the variable to the console with a newline character after it.  Make sure to select the ‘Preformatted’ style from the dropdown so your code is formatted clearly. DO NOT USE THE TAB KEY WHEN WRITING CODE AS YOU MAY ACCIDENTALLY SUBMIT YOUR EXAM. USE THE SPACE BAR INSTEAD.

Read Details

Will the following code compile, and if it does, what will t…

Will the following code compile, and if it does, what will the value of myInt be?  double myDouble = 10.99; int myInt = (int)myDouble; 

Read Details

Convert the following switch statement to an if-else block s…

Convert the following switch statement to an if-else block so the output is the same for all cases. Assume the switch variable is already declared and initialized. Note that some lines may need to be blank, if that is the case and there are multiple lines in the block, the blank line MUST BE THE LAST LINE in the block.  For example (follow this format):   if (a == 10) { sum += 10; //LEAVE BLANK }   Instead of (do NOT do this):   if (a == 10) { //LEAVE BLANK sum += 10; }  Some lines may be used once, never, or multiple times.  switch (doggo) { case ‘r’: System.out.println(“rocko”); case ‘c’: System.out.println(“chispa”); break; default: System.out.println(“nope”); case ‘m’: System.out.println(“moccita”); }     if (1._______________) {  2._______________________ 3._______________________ } else if (4._______________) { System.out.println(“chispa”); } else if (5.________________) {  System.out.println(“moccita”); } else { 6._______________________ 7._______________________     } 

Read Details

Given the if/else block, choose the corresponding ternary ex…

Given the if/else block, choose the corresponding ternary expression.   int a = 8; int b = 15; int result;if (b > a) { result = a + b; } else { result = b / a; } 

Read Details

Posts pagination

Newer posts 1 … 48,102 48,103 48,104 48,105 48,106 … 57,452 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top