Exam 7: Object-Oriented Design

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

It is important to dissect a problem into manageable pieces before trying to solve the problem because

(Multiple Choice)
4.9/5
(38)

Which of the following GUI classes requires that it have a LayoutManager before any GUI components are added to it?

(Multiple Choice)
4.9/5
(41)

Unlike the String class where you must pass a message to an object (instance) of the class, as in x.length( ), in order to use the Math class, you pass messages directly to the class name, as in Math.abs( ) or Math.sqrt( ).

(True/False)
4.8/5
(33)

Draw the JFrame as you think it would appear given the following set of code: JButton jb1 = new JButton("A"); JButton jb2 = new JButton("B"); JButton jb3 = new JButton("C"); JButton jb4 = new JButton("D"); JButton jb5 = new JButton("E"); JButton jb6 = new JButton("F"); JButton jb7 = new JButton("G"); JButton jb8 = new JButton("H"); JButton jb9 = new JButton("I"); JButton jb10 = new JButton("J"); JButton jb11 = new JButton("K"); JButton jb12 = new JButton("L"); JPanel jp1 = new JPanel( ); jp1.add(jb1); jp1.add(jb2); jp1.add(jb3); jp1.add(jb4); JPanel jp2 = new JPanel(new GridLayout(4, 1)); jp2.add(jb5); jp2.add(jb6); jp2.add(jb7); jp2.add(jb8); JPanel jp3 = new JPanel(new GridLayout(2, 2)); jp3.add(jb9); jp3.add(jb10); jp3.add(jb11); jp3.add(jb12); JPanel jp4 = new JPanel(new BorderLayout( )); jp4.add(jp1, BorderLayout.NORTH); jp4.add(jp2, BorderLayout.EAST); jp4.add(jp3, BorderLayout.WEST); JFrame jf = new JFrame( ); jf.getContentPane( ).add(jp4); jf.pack( ); jf.setVisible(True);

(Essay)
4.8/5
(41)

Abstract methods are used when defining

(Multiple Choice)
4.9/5
(42)

The goal of testing is to

(Multiple Choice)
4.8/5
(28)

For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter. Pieces are ordered as follows: "Pawn" is a lesser piece to a "Knight" and a "Bishop", "Knight" and "Bishop" are equivalent for this example, both are lesser pieces to a "Rook" which is a lesser piece to a "Queen" which is a lesser piece to a "King." -Which of the following method headers would properly define the method needed to make this class Comparable?

(Multiple Choice)
4.8/5
(37)

Interface classes cannot be extended but classes that implement interfaces can be extended.

(True/False)
4.8/5
(26)

If a GUI container is resized by the user, all components of the GUI are automatically increased or decreased by the same fraction to fit in the newly sized container.

(True/False)
4.9/5
(36)

A bad programming habit is to build an initial program and then spend a great deal of time modifying the code until it is acceptable. This is known as

(Multiple Choice)
4.8/5
(37)

Any class can implement an interface, but no classes can implement more than a single interface.

(True/False)
4.9/5
(49)

Draw the JFrame as you think it would appear given the following set of code: JButton jb1 = new JButton("A"); JButton jb2 = new JButton("B"); JButton jb3 = new JButton("C"); JButton jb4 = new JButton("D"); JButton jb5 = new JButton("E"); JButton jb6 = new JButton("F"); JButton jb7 = new JButton("G"); JPanel jp1 = new JPanel(new GridLayout(3, 3)); jp1.add(jb1); jp1.add(jb2); jp1.add(jb3); jp1.add(jb4); jp1.add(jb5); jp1.add(jb6); jp1.add(jb7); JFrame jf = new JFrame( ); jf.getContentPane( ).add(jp1); jf.pack( ); jf.setVisible(True);

(Essay)
4.8/5
(34)

Modifying a program in order to eliminate deficiencies is done in the ________ phase of the development cycle.

(Multiple Choice)
4.9/5
(37)

During program development, software requirements specify

(Multiple Choice)
4.9/5
(38)

The JFrame below has a JBorder created using which of the following BorderFactory formats? The JFrame below has a JBorder created using which of the following BorderFactory formats?

(Multiple Choice)
5.0/5
(33)

Defining formal parameters requires including each parameters type.

(True/False)
4.9/5
(39)

The most important decisions regarding the development of a system are made during the implementation phase while code is actively being written.

(True/False)
4.8/5
(39)

The idea that an object can exist separate from the executing program that creates it is called

(Multiple Choice)
4.7/5
(37)

Having multiple class methods of the same name where each method has a different number of or type of parameters is known as

(Multiple Choice)
4.9/5
(49)

Why was the Y2K problem a problem of software maintenance and not a problem of software testing?

(Essay)
4.8/5
(34)
Showing 21 - 40 of 76
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)