GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

These two ways to set up a String will yield identical resul…

These two ways to set up a String will yield identical results:String my_string = new String(“123.45”);String my_string = “” + 123.45;

Read Details

Refer to Code Segment 1. If x is currently 0, a = 1 and b =…

Refer to Code Segment 1. If x is currently 0, a = 1 and b = -1, what will x become after the statement shown is executed? 

Read Details

Write a declaration for a Rectangle named squareShape that i…

Write a declaration for a Rectangle named squareShape that is 400 pixels wide, 400 pixels high, and its upper-left corner position is at point (50, 50).

Read Details

Refer to Class Definition Code Segment 3: Assume that anothe…

Refer to Class Definition Code Segment 3: Assume that another method has been defined that will compute and return the student’s class rank (Freshman, Sophomore, etc).  It is defined as:    public String getClassRank()Given that s1 is a student, which of the following would properly be used to get s1’s class rank? 

Read Details

Which of the following reserved words in Java is used to cre…

Which of the following reserved words in Java is used to create an instance of a class?

Read Details

In order to preserve encapsulation of an object, we would do…

In order to preserve encapsulation of an object, we would do all of the following except for which one?

Read Details

Write a while loop that verifies that the user enters a posi…

Write a while loop that verifies that the user enters a positive integer value.

Read Details

What does the following code fragment do?Circle circle = new…

What does the following code fragment do?Circle circle = new Circle(100, 100, 50);circle.setFill(Color.GREEN);Rectangle rectangle = new Rectangle(70, 70, 225, 75);rectangle.setStroke(Color.BLUE);rectangle.setStrokeWidth(2);rectangle.setFill(null);

Read Details

Write a method called random100 that returns a random intege…

Write a method called random100 that returns a random integer in the range of 1 to 100 (inclusive).

Read Details

Code segment 2 import java.util.Scanner;     public class Qu…

Code segment 2 import java.util.Scanner;     public class Questions     {        public static void main(String[] args)        {         int x, y, z;         double average;         Scanner scan = new Scanner(System.in);         System.out.println(“Enter an integer value”);         x = scan.nextInt();         System.out.println(“Enter another integer value”);         y = scan.nextInt();         System.out.println(“Enter a third integer value”);         z = scan.nextInt();         average = (x + y + z) / 3;         System.out.println(“The result of my calculation                              is ” + average);        }     } Refer to Code Segment 2: This code computes  

Read Details

Posts pagination

Newer posts 1 … 46,442 46,443 46,444 46,445 46,446 … 95,349 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top