Skip to main content

Programming Logic and Design Exam Preparation Guide - 1208 Verified Questions

Page 1


Programming Logic and Design

Exam Preparation Guide

Course Introduction

Programming Logic and Design introduces students to the fundamental concepts behind computer programming and problem-solving. The course emphasizes the use of structured algorithms, flowcharts, and pseudocode to create clear, logical solutions to common problems before actual coding begins. Topics include variables, data types, control structures (such as sequence, selection, and repetition), modular design, input/output concepts, and debugging techniques. By focusing on core logic and design principles rather than specific programming languages, students develop a strong foundation that can be applied to learning any programming language in future courses.

Recommended Textbook

Java Programming 7th Edition by Joyce Farrell

Available Study Resources on Quizplus

17 Chapters

1208 Verified Questions

1208 Flashcards

Source URL: https://quizplus.com/study-set/1207

Page 2

Chapter 1: Creating Java Programs

Available Study Resources on Quizplus for this Chatper

68 Verified Questions

68 Flashcards

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

Sample Questions

Q1) ____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the information to perform its task or carry out its purpose.

A) Applets

B) Methods

C) Arguments

D) Objects

Answer: C

Q2) System.out.println("First Java application");

Given the above code, identify and describe the use of a literal string and the use of parentheses.

Answer: A literal string is a series of characters that will appear exactly as entered. Any literal string in Java is written between double quotation marks. The literal string "First Java application" is passed to the println method.

Q3) You use an import statement when you want to access a built-in Java class that is contained in a group of classes called a(n) ____________________.

Answer: package

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

Chapter 2: Using Data

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) Created by placing the desired result type in parentheses

A)operand

B)cast operator

C)assignment

D)operator precedence

E)garbage

F)primitive

G)float

H)boolean

I)escape sequence

Answer: B

Q2) ____ occurs when both of the operands are integers.

A) Data modeling

B) Type cast

C) Integer division

D) Unlike assignment

Answer: C

Q3) A(n) ____________________ is a simple data type.

Answer: primitive type

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

Page 4

Chapter 3: Using Methods, Classes, and Objects

Available Study Resources on Quizplus for this Chatper

68 Verified Questions

68 Flashcards

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

Sample Questions

Q1) A(n) ____ is a program module that contains a series of statements that carry out a task.

A) argument

B) method

C) application

D) declaration

Answer: B

Q2) The first line of a method

A)return statement

B)header

C)instance variables

D)methods signature

E)formal parameters

F)static method

G)data fields

H)parameter type

I)class user

Answer: B

Q3) Access specifiers are also called access ____________________.

Answer: modifiers

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

Chapter 4: More Object Concepts

Available Study Resources on Quizplus for this Chatper

67 Verified Questions

67 Flashcards

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

Sample Questions

Q1) An illegal action

A)optional classes

B)instance variables

C)comes into scope

D)class methods

E)overloading

F)Math class

G)redeclaring a variable

H)GregorianCalendar

I)constant

Q2) Declare a GregorianCalendar object named year. Use the GregorianCalendar class and the get() method to display the current year in a println statement.

Q3) Using an example, explain how nested blocks are created.

Q4) When working with the GregorianCalendar class, what is the statement that will import the GregorianCalendar class using the full class path? Likewise, what statement will import the GregorianCalendar class and any other java.util classes?

Q5) When you ____________________ methods, you risk creating an ambiguous situation-one in which the compiler cannot determine which method to use.

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

Chapter 5: Making Decisions

Available Study Resources on Quizplus for this Chatper

70 Verified Questions

70 Flashcards

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

Sample Questions

Q1) When using equals and not equals for comparisons with objects, you compare the objects' ____ instead of actual values.

A) reference fields

B) primitive data types

C) Boolean values

D) memory addresses

Q2) A(n) ____________________ structure is one that involves choosing between alternative courses of action based on some value within a program.

Q3) You write pseudocode in everyday language, not the syntax used in a programming language.

A)True

B)False

Q4) A logical structure called a(n) ____ structure is when one step follows another unconditionally.

A) straight

B) decision

C) sequence

D) unconditional

Q5) List and explain the keywords used with the switch statement.

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

Chapter 6: Looping

Available Study Resources on Quizplus for this Chatper

72 Verified Questions

72 Flashcards

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

Sample Questions

Q1) The value that determines whether loop execution continues

A)prefix ++

B)block

C)definite loop

D)loop control variable

E)binary operators

F)loop fusion

G)decrementing

H)for loop

I)sleep() method

Q2) An indefinite loop is a(n) ____ loop.

A) counter-controlled

B) event-controlled

C) initialized

D) validating

Q3) When nesting loops, the variable in the outer loop changes more frequently.

A)True

B)False

Q4) What are some of the shortcuts Java provides programmers for incrementing and accumulating? Give examples of statements.

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

Chapter 7: Characters, Strings, and the Stringbuilder

Available Study Resources on Quizplus for this Chatper

73 Verified Questions

73 Flashcards

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

Sample Questions

Q1) import javax.swing.JOptionPane; public class Practice

{ public static void main(String[] args) { String fullName; char firstLetter;

Accepting a String from a user is common practice. Using the above code, write the statements to accept a String response from a user. Prompt the user with "Enter your name". Then use the charAt() method to extract the first character of the String.

Q2) The StringBuilder class is more efficient than the StringBuffer class because it can execute multiple threads during program execution.

A)True

B)False

Q3) How can you change the length of a String in a StringBuilder object?

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

Page 9

Chapter 8: Arrays

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) When you initialize parallel arrays, it is convenient to use ____ so that the values that correspond to each other visually align on the screen or printed page.

A) tabs

B) indentation

C) spacing

D) dashes

Q2) Write the statement to declare an array of integers that will hold studentScores.

Q3) You use a ____ following the closing brace of an array initialization list.

A) .

B) ;

C) :

D) ,

Q4) String[] countyNames = {"Clark", "Delaware", "Madison"}; What will be the value of countyNames[0].length(), countyNames[1].length(), and countyNames[2].length()?

Q5) An instance variable or object field is also called a(n) ____________________ of the object.

Q6) What does an array's name represent and what value does it hold when declared?

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

Chapter 9: Advanced Array Concepts

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) The ArrayList class ____ method returns the current ArrayList size.

A) size

B) capacity

C) length

D) rows

Q2) The Arrays class ____________________ method assigns the specified value to each element of the specified array.

Q3) double[][] empSales = new double[5][]; The above statement declares a(n) ____ array.

A) insertion

B) sort

C) ragged

D) boolean

Q4) A method that receives a two-dimensional array uses two ____________________ pairs following the data type in the parameter list of the method header.

Q5) The simplest possible sort involves two values that are out of order.

A)True

B)False

Q6) Write the code for bubble sorting a someNums array of integers.

Page 11

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

Chapter 10: Introduction to Inheritance

Available Study Resources on Quizplus for this Chatper

70 Verified Questions

70 Flashcards

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

Sample Questions

Q1) Keeps data private

A)information hiding

B)inheritance

C)super()

D)superclass

E)instanceof

F)virtual method call

G)inlining

H)class diagram

I)derived class

Q2) A part of UML

A)information hiding

B)inheritance

C)super()

D)superclass

E)instanceof F)virtual method call

G)inlining

H)class diagram

I)derived class

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

Page 12

Chapter 11: Advanced Inheritance Concepts

Available Study Resources on Quizplus for this Chatper

70 Verified Questions

70 Flashcards

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

Sample Questions

Q1) What is an abstract class? Give an example and explain how it works.

Q2) Considers two objects of the same class to be equal only if they have the same hash code

A)dynamic method binding

B)collision

C)GregorianCalendar

D)multiple inheritance

E)equals() method

F)-d option

G)java.lang

H)public, static, and final

I)interface

Q3) When you create a number of classes that inherit from each other, as well as multiple interfaces that you want to implement with these classes, you often will find it convenient to place these related classes in a(n) ____________________.

Q4) What are the advantages to creating a useful, extendable superclass?

Q5) In the Java programming language, a package or class library is often delivered to users as a(n) ____________________ file.

Q6) Why do many programmers consider multiple inheritance to be a difficult concept?

Page 13

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

Chapter 12: Exception Handling

Available Study Resources on Quizplus for this Chatper

65 Verified Questions

65 Flashcards

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

Sample Questions

Q1) Placing data conversion attempts in a try block allows you to handle potential data conversion errors caused by careless user entry.

A)True

B)False

Q2) What advantage to programmers does the technique of cycling through the methods in the stack offer? Why?

Q3) ____ exceptions are the type that programmers should anticipate and from which programs should be able to recover.

A) Unchecked

B) Runtime

C) Checked

D) Thrown

Q4) What are the elements that make up a try block?

Q5) When an exception is a checked exception, client programmers are forced to deal with the possibility that an exception will be thrown.

A)True

B)False

Q6) What things might a programmer do to cause a potential exception in a program?

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

Chapter 13: File Input and Output

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) Java lets you assign a file to a(n) ____ object so that screen output and file output work in exactly the same manner.

A) Stream

B) Input

C) Output

D) File

Q2) While System.err and System.out are both directed by default to the monitor command line, System.err is usually reserved for error messages and System.out is reserved for valid output.

A)True

B)False

Q3) A file channel is ____, meaning you can search for a specific file location and operations can start at any specified position.

A) moveable

B) seekable

C) flexible

D) dynamic

Q4) ____________________ is an abstract class that contains methods for performing output.

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

Chapter 14: Introduction to Swing Components

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) You define the text to be displayed in a tool tip by using the setToolTipText() method and passing an appropriate ____ to it.

A) Integer

B) Date

C) String

D) Boolean

Q2) Within an implementation of the itemStateChanged() method, you can use the ____ method to determine which object generated the event, and the getStateChange() method to determine whether the event was a selection or a deselection.

A) getSource()

B) getEvent()

C) getItem()

D) getState()

Q3) What class is the immediate parent of JFrame?

A) Container

B) Component

C) Frame

D) Window

Q4) How do you modify whether or not a JTextField can be edited?

Page 16

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

Chapter 15: Advanced Gui Topics

Available Study Resources on Quizplus for this Chatper

69 Verified Questions

69 Flashcards

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

Sample Questions

Q1) You use FlowLayout when you want fixed rows and columns of components, and when you want the components to fill available space.

A)True

B)False

Q2) The parent class for all event objects is named ____, which descends from the Object class.

A) EventObject

B) Event

C) ParentEvent

D) AWTEvent

Q3) Each JMenu can contain options, called JMenuItems, or can contain submenus that are ____.

A) JMenuBars

B) JMenuChildren

C) JSubMenus

D) JMenus

Q4) Describe the way in which components expand to fill their layout areas in FlowLayout and BorderLayout.

Q5) Describe the two CardLayout constructors.

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

Chapter 16: Graphics

Available Study Resources on Quizplus for this Chatper

74 Verified Questions

74 Flashcards

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

Sample Questions

Q1) Measures the parts of characters that "hang below" the baseline

A)fill pattern

B)GREEN

C)acyclic gradient

D)3D method

E)Line2D.Float class

F)fillPolygon()

G)getScreenResolution()

H)GeneralPath

I)descent

Q2) BasicStroke myLine = new BasicStroke(12.0f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND);

The above statement creates a BasicStroke object and makes it the current stroke. Describe the three arguments that are used in this statement, and then describe the purpose of each.

Q3) Write the statement to create an Arc2D.Float object named myArc at 20, 143, with a width of 50 and a height of 43; with a starting degree of 50, 140 degrees traveled; and using the class variable Arc2D.PIE.

Q4) What activities does the process of drawing with Java 2D objects include?

Q5) What are the three arguments the BasicStroke constructor takes?

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

Chapter 17: Applets, Images, and Sound

Available Study Resources on Quizplus for this Chatper

72 Verified Questions

72 Flashcards

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

Sample Questions

Q1) In order to play sounds more than once, or to stop and start sounds, the sound must be loaded into an AudioClip object. Write the statement to load the AudioClip named myClip with the sound file myTune.au, which is located in the audio folder.

Q2) Use the ____ applet method to perform initialization tasks, such as setting variables to initial values or placing applet components on the screen.

A) initialize()

B) begin()

C) init()

D) start()

Q3) Provides a convenient environment in which to test your applets

A)current version of HTML

B)init()

C)start()

D)HTML

E)Applet Viewer

F)tags

G)multimedia

H)applet

I)play()

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

Page 19

Turn static files into dynamic content formats.

Create a flipbook