Skip to main content

Programming Methodologies Review Questions - 620 Verified Questions

Page 1


Programming Methodologies

Review Questions

Course Introduction

Programming Methodologies introduces students to the foundational principles and approaches used in designing, developing, and analyzing computer programs. The course explores various programming paradigms, such as procedural, object-oriented, and functional programming, while emphasizing best practices in software engineering, modularity, code reusability, and maintainability. Students gain practical experience through problem-solving and project-based assignments, learning to apply abstraction, algorithmic thinking, testing, and debugging techniques. By the end of the course, students are equipped with the essential skills and mindsets required to tackle complex programming challenges efficiently and systematically.

Recommended Textbook

Starting Out with Java Early Objects 5th Edition by Tony Gaddis

Available Study Resources on Quizplus

16 Chapters

620 Verified Questions

620 Flashcards

Source URL: https://quizplus.com/study-set/1061 Page 2

Chapter 1: Introduction to Computers and Java

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20979

Sample Questions

Q1) Because Java byte code is the same on all computers, compiled Java programs

A) are non-existent.

B) must be re-compiled for each different machine it is run on.

C) are highly portable.

D) cannot run on computers with different operating systems.

Answer: C

Q2) ________ is a cross between human language and a programming language.

A) The compiler

B) Pseudocode

C) The Java Virtual Machine

D) Java

Answer: B

Q3) A(n) ________ is a software entity that contains data and procedures.

A) object

B) program

C) class

D) method

Answer: A

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Java Fundamentals

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20980

Sample Questions

Q1) In the following Java statement what value is stored in the variable name? String name = "John Doe";

A) "name"

B) the memory address where "John Doe" is located

C) the memory address where name is located

D) "John Doe"

Answer: B

Q2) If you use a flag in a format specifier, you must write the flag before the field width and the precision.

A)True

B)False

Answer: True

Q3) Which of the following is not a valid Java comment?

A) /** Comment 1 */

B) */ Comment 2 /*

C) // Comment 3

D) /* Comment 4 */

Answer: B

To view all questions and flashcards with answers, click on the resource link above. Page 4

Chapter 3: A First Look at Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20981

Sample Questions

Q1) In the blueprint/house analogy, think of a class as a blueprint that describes a house and ________ as instances of the house built from the blueprint.

A) methods

B) fields

C) objects

D) attributes

Answer: C

Q2) For the following code, which statement is not true?

Public class Circle

{ private double radius; Public double x; Private double y;

}

A) The y field is available to code that is written outside the Circle class.

B) The radius field is not available to code written outside the Circle class.

C) The radius, x, and y fields are members of the Circle class.

D) The x field is available to code that is written outside the Circle class.

Answer: A

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Decision Structures

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20982

Sample Questions

Q1) What would be the value of x after the following statements were executed?

Int x = 10; Switch (x) { Case 10: X += 15; Case 12: X -= 5; Break;

Default: X *= 3; }

A) 30

B) 20

C) 25

D) 5

Q2) The if-else statement will execute one group of statements if its boolean expression is true, or another group if its boolean expression is false.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above.

Page 6

Chapter 5: Loops and Files

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20983

Sample Questions

Q1) A loop that executes as long as a particular condition exists is called a(n) ________ loop.

A) infinite

B) count-controlled

C) conditional

D) relational

Q2) This is an item that separates other items.

A) partition

B) delimiter

C) sentinel

D) terminator

Q3) A(n) ________ is a special value that cannot be mistaken as a member of a list of data items and signals that there are no more data items from the list to be processed. A) accumulator

B) sentinel

C) delimiter

D) terminator.

To view all questions and flashcards with answers, click on the resource link above.

Chapter 6: A Second Look at Classes and Objects

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20984

Sample Questions

Q1) To get the name of a calling enum constant,

A) simply use the enum constant in the statement.

B) use the ordinal method.

C) use the displayName method.

D) use the toString method.

Q2) Overloading is

A) writing a method that does too much processing.

B) writing a program that is too large to fit in memory.

C) having two or more methods with the same name, but different signatures.

D) having two or more methods with the same signature.

Q3) When the this variable is used to call a constructor

A) it must be the first statement in the constructor making the call.

B) it can be anywhere in the constructor making the call.

C) it must be the last statement in the constructor making the call.

D) You cannot use the this variable in a constructor call.

Q4) ________ is the term for the relationship created by object aggregation.

A) "Has a"

B) Inner class

C) "Is a"

D) One-to-many

Page 8

To view all questions and flashcards with answers, click on the resource link above.

Chapter 7: Arrays and the ArrayList Class

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20985

Sample Questions

Q1) When an array is passed to a method

A) it is passed just as any other object would be.

B) the method has direct access to the original array.

C) a reference to the array is passed.

D) All of the above

Q2) A sorting algorithm is used to locate a specific item in a larger collection of data.

A)True

B)False

Q3) Which of the statements are true about the following code?

Final int ARRAY_SIZE = 10;

Long[] array1 = new long[ARRAY_SIZE];

A) declares array1 to be a reference to an array of long values

B) creates an instance of an array of 10 long values

C) will allow valid subscripts in the range of 0 through 9

D) All of the above

Q4) An ArrayList object automatically expands in size to accommodate the items stored in it.

A)True B)False

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Text Processing and Wrapper Classes

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20986

Sample Questions

Q1) What will be displayed after the following code has been executed?

Boolean matches;

String str1 = "The cow jumped over the moon."; String str2 = "moon";

Matches = str1.endsWith(str2); System.out.println(matches);

A) true

B) moon

C) false

D) The cow

Q2) Which of the following statements converts a String object variable named str to an int and stores the value in the variable x?

A) int x = Integer.integer(str);

B) int x = str;

C) int x = Integer.parseInteger(str);

D) int x = Integer.parseInt(str);

Q3) Trying to extract more tokens than exist from a StringTokenizer object will cause an error.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Inheritance

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20987

Sample Questions

Q1) When an "is a" relationship exists between objects, it means that the specialized object has

A) some of the characteristics of the general class, but not all, plus additional characteristics.

B) some of the characteristics of the general object, but not all.

C) none of the characteristics of the general object.

D) all the characteristics of the general object, plus additional characteristics that make it special.

Q2) You can use this operator to determine whether an object is an instance of a particular class.

A) equals

B) instanceof

C) >>

D) isa

Q3) In the following statement, which is the superclass?

Public class ClassA extends ClassB implements ClassC

A) ClassA

B) ClassB

C) ClassC

D) ClassB and ClassC

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Exceptions and Advanced File I/O

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20988

Sample Questions

Q1) In a catch statement, what does the following code do? System.out.println(e.getMessage());

A) It prints the code that caused the exception.

B) It prints the stack trace.

C) It prints the error message for an exception.

D) It overrides the toString method.

Q2) In order for an object to be serialized, the class must implement this interface.

A) Serial

B) Serializable

C) ObjectOutputStream

D) Writable

Q3) If a random access file contains a stream of characters, which of the following statements would move the file pointer to the starting byte of the fifth character in the file?

A) file.seek(4);

B) file.seek(8);

C) file.seek(10);

D) file.seek(5);

To view all questions and flashcards with answers, click on the resource link above.

Chapter 11: GUI Applications Part 1

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20989

Sample Questions

Q1) The ActionListener interface is in this package.

A) java.awt.event

B) javax.swing.event

C) java.lang.event

D) java.action.event

Q2) Programs that operate in a GUI environment must be event-driven.

A)True

B)False

Q3) By default, a window is hidden from view when the close button is clicked, but the application is not terminated.

A)True

B)False

Q4) This is a graphic image that is displayed while an application loads into memory and starts up.

A) loading icon

B) splash screen

C) screen saver

D) Java logo

To view all questions and flashcards with answers, click on the resource link above. Page 13

Chapter 12: GUI Applications Part 2

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20990

Sample Questions

Q1) What will be the result when the following code is executed?

ImagePanel = new JPanel();

ImageLabel = new JLabel(); ImagePanel.Add(imageLabel);

ImageIcon sunnyFaceImage = new ImageIcon("SunnyFace.gif"); imageLabel.setIcon(sunnyFaceImage);

Pack();

A) The image will resize itself to fit the label.

B) The image will resize itself to fit the panel.

C) The panel will resize itself to accommodate the image.

D) The JFrame that encloses the window will resize itself to accommodate the image.

Q2) What is the default directory for the JFileChooser constructor when you pass a String containing a valid path as an argument?

A) If you are using Windows, this will probably be the "My Documents" folder under your account.

B) If you are using UNIX, this will be your login directory.

C) Both A and B

D) None of the above

To view all questions and flashcards with answers, click on the resource link above.

14

Chapter 13: Applets and More

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20991

Sample Questions

Q1) An HTML document is usually saved with this file name extension.

A) .xml

B) .html

C) .asp

D) .cfm

Q2) A mouse listener class must implement this interface, which is in the java.awt.event package.

A) MouseEvent

B) MouseListener

C) MouseAction

D) MouseInterface

Q3) Once you create a mouse listener class, you can register it with a component using this method, which is inherited from the Component class.

A) addMouseListener

B) getMouseListenerEvent

C) initMouseListener

D) addMouseListenerEvent

Q4) The mouse generates two types of events: mouse events and mouse motion events.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 15

Chapter 14: Creating GUI Applications with JavaFX

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20992

Sample Questions

Q1) A(n) ________ is a method that automatically executes when a specific event occurs.

A) flag register

B) action scheduler

C) callback routine

D) event listener.

Q2) Although these are often displayed in groups, they are not usually grouped in a toggle group like RadioButtons are.

A) Labels

B) CheckBoxes

C) Buttons

D) TextFields

Q3) To place a component in a GUI, you simply drag it from the Library Panel, and drop it into the

A) Content Panel.

B) Hierarchy Panel.

C) Selection Bar.

D) Inspector Panel.

To view all questions and flashcards with answers, click on the resource link above. Page 16

Chapter 15: Recursion

Available Study Resources on Quizplus for this Chatper

20 Verified Questions

20 Flashcards

Source URL: https://quizplus.com/quiz/20993

Sample Questions

Q1) A method is called from the main method for the first time. It then calls itself seven times. What is the depth of recursion?

A) 1

B) 7

C) 8

D) 6

Q2) In the ________, we must always reduce the problem to a smaller version of the original problem.

A) base case

B) partition case

C) lessening case

D) recursive case

Q3) The number of times that a method calls itself is known as A) the call count.

B) the cyclic identity.

C) the method heap.

D) the depth of recursion.

Q4) Without a base case, a recursive method will call itself only once and stop. A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 17

Chapter 16: Databases

Available Study Resources on Quizplus for this Chatper

40 Verified Questions

40 Flashcards

Source URL: https://quizplus.com/quiz/20994

Sample Questions

Q1) The term commit refers to undoing changes to a database.

A)True

B)False

Q2) The DBMS works directly with the data, and sends the results of operations

A) back to the application.

B) along the encrypted data path.

C) to the unified data component.

D) back to the Web server.

Q3) What does JDBC stand for?

A) Java data binary collection

B) Java database connectivity

C) Java database collection

D) Java data basic computation

Q4) In SQL, this character can be used as a wildcard to represent a single character.

A) %

B) $

C) _

D) *

To view all questions and flashcards with answers, click on the resource link above.

Page 18

Turn static files into dynamic content formats.

Create a flipbook
Programming Methodologies Review Questions - 620 Verified Questions by Quizplus - Issuu