Programming Logic and Design MCQ PDF
Programming Logic and Design MCQ PDF
MCQ PDF
https://quizplus.com/study-set/1747
17 Chapters
953 Verified Questions
Programming Logic and Design
MCQ PDF
Cou
Programming Logic and Design introduces students to the fundamental concepts and
emphasizes the development of logical thinking skills and the use of structured
Students will learn how to analyze problems, break them down into manageable
components, and design step-by-step solutions before translating these solutions into
processing, modular design, and debugging strategies, providing a solid foundation for
Recommended Textbook
Starting Out with Java From Control Structures through Objects 6th Edition by Tony Gaddis
Page 2
Chapter 1: Introduction to Computers and Java
Available Study Resources on Quizplus for this Chatper
51 Verified Questions
51 Flashcards
Source URL: https://quizplus.com/quiz/34833
Sample Questions
Q1) The major components of a typical computer system consist of:
A) The CPU
B) Input/output devices
C) Main memory
D) Secondary storage devices
E) All of the above
Answer: E
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
61 Verified Questions
61 Flashcards
Source URL: https://quizplus.com/quiz/34836
Sample Questions
Q1) To compile a program named First, use the following command:
A) java First.java
B) javac First
C) javac First.java
D) compile First.javac
Answer: C
Q2) A Java program will not compile unless it contains the correct line numbers.
A)True
B)False
Answer: False
Q3) The boolean data type may contain values in the following range of values
A) true or false
B) -128 to + 127
C) - 2,147,483,648 to +2,147,483,647
D) - 32,768 to +32,767
Answer: A
Q4) Both character literals and string literals can be assigned to a char variable.
A)True
B)False
Answer: False
To view all questions and flashcards with Page 4 click on the resource link above.
answers,
Chapter 3: Decision Structures
Available Study Resources on Quizplus for this Chatper
64 Verified Questions
64 Flashcards
Source URL: https://quizplus.com/quiz/34824
Sample Questions
Q1) An important style rule you should follow when writing if statements is to line up the
conditionally executed statement with the if statement.
A)True
B)False
Answer: False
Q3) An important style rule you should adopt for writing if statements is to write the
conditionally executed statement on the line after the if statement.
A)True
B)False
Answer: True
To view all questions and flashcards with answers, click on the resource link above.
Page 5
Chapter 4: Loops and Files
Available Study Resources on Quizplus for this Chatper
57 Verified Questions
57 Flashcards
Source URL: https://quizplus.com/quiz/34835
Sample Questions
Q1) In a for statement, the control variable can only be incremented.
A)True
B)False
Q2) If you are using a block of statements, don't forget to enclose all of the statements in
a set of:
A) Braces
B) Double quotes
C) Semicolons
D) Parentheses
Q3) This type of loop is ideal in situations where you always want the loop to iterate at
least once.
A) while loop
B) do-while loop
C) for loop
D) if statement
Q4) When the break statement is encountered in a loop, all the statements in the body
of the loop that appear after it are ignored, and the loop prepares for the next iteration.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 6
Chapter 5: Methods
Available Study Resources on Quizplus for this Chatper
60 Verified Questions
60 Flashcards
Source URL: https://quizplus.com/quiz/34823
Sample Questions
Q1) When a method tests an argument and returns a true or False value, it should return:
A) a zero for true and a one for False
B) a boolean value
C) a zero for False and a non-zero for true
D) a method should not be used for this type test
To view all questions and flashcards with answers, click on the resource link above.
Page 7
Chapter 6: A First Look at Classes
Available Study Resources on Quizplus for this Chatper
58 Verified Questions
58 Flashcards
Source URL: https://quizplus.com/quiz/34822
Sample Questions
Q1) The scope of a private instance field is:
A) the instance methods of the same class
B) inside the class, but not inside any method
C) inside the parentheses of a method header
D) the method in which they are defined
Q2) Class objects normally have ________ that perform useful operations on their
data, but primitive variables do not.
A) fields
B) instances
C) methods
D) relationships
To view all questions and flashcards with answers, click on the resource link above.
Page 8
Chapter 7: Arrays and the Arraylist Class
Available Study Resources on Quizplus for this Chatper
64 Verified Questions
64 Flashcards
Source URL: https://quizplus.com/quiz/34834
Sample Questions
Q1) To compare the contents of two arrays, you must compare the elements of the two
arrays.
A)True
B)False
Q3) Java does not limit the number of dimensions that an array may have.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 9
Chapter 8: A Second Look at Classes and Objects
Available Study Resources on Quizplus for this Chatper
50 Verified Questions
50 Flashcards
Source URL: https://quizplus.com/quiz/34821
Sample Questions
Q1) The term for the relationship created by object aggregation is:
A) has a
B) is a
C) Sub-class object
D) Inner class
Q4) The key word this is the name of a reference variable that an object can use to refer
to itself.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 10
Chapter 9: Text Processing and More About Wrapper
Classes
Available Study Resources on Quizplus for this Chatper
60 Verified Questions
60 Flashcards
Source URL: https://quizplus.com/quiz/34820
Sample Questions
Q1) What is the value of str after the following code has been executed?
String str;
String sourceStr = "Hey diddle, diddle, the cat and the fiddle";
Str = sourceStr.substring(12,17);
A) diddle
B) diddl
C) , didd
D) Iddle
Q2) The String class's valueOf() method accepts a string representation as an argument
and returns its equivalent integer value.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Chapter 10: Inheritance
Available Study Resources on Quizplus for this Chatper
70 Verified Questions
70 Flashcards
Source URL: https://quizplus.com/quiz/34832
Sample Questions
Q1) What is wrong with the following code?
IntCalculator square = new IntCalculator() {
Public int calculate(int number)
{
Return number * number;
}}
A) The outer braces are not needed.
B) The inner braces are not needed.
C) The new key word is not needed.
D) The statement does not end with a semicolon.
To view all questions and flashcards with answers, click on the resource link above.
Page 12
Chapter 11: Exceptions and Advanced File IO
Available Study Resources on Quizplus for this Chatper
56 Verified Questions
56 Flashcards
Source URL: https://quizplus.com/quiz/34831
Sample Questions
Q1) What will be the result of the following statements?
FileInputStream fstream =
New FileInputStream("DataIn.dat");
DataInputStream inFile =
New DataInputStream(fstream);
A) The inFile variable will reference an object that is able to read only text data from the
Input.dat file.
B) The inFile variable will reference an object that is able to read binary data from the
Input.dat file.
C) The inFile variable will reference an object that is able to write binary data to the
Input.dat file.
D) The inFile variable will reference an object that is able to read random access data
from the Input.dat file.
Q2) When deserializing an object using the readObject method, you must cast the return
value to the desired class type.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 13
Chapter 12: A First Look at GUI Applications
Available Study Resources on Quizplus for this Chatper
60 Verified Questions
60 Flashcards
Source URL: https://quizplus.com/quiz/34830
Sample Questions
Q1) To include Swing and AWT components in your program, use the following import
statements:
A) import java.swing; import java.awt;
B) import java.swing; import javax.awt;
C) import javax.swing; import java.awt;
D) import javax.swing; import javax.awt;
Q2) To use the ActionListener interface, as well as other event listener interfaces, you
must have the following import statement in your code:
A) import java.swing;
B) import java.awt;
C) import java.awt.*;
D) import java.awt.event.*;
Q3) You must use the statement import java.swing.*; in order to use the ItemListener
interface.
A)True
B)False
To view all questions and flashcards with answers, click on the resource link above.
Page 14
Chapter 13: Advanced GUI Applications
Available Study Resources on Quizplus for this Chatper
58 Verified Questions
58 Flashcards
Source URL: https://quizplus.com/quiz/34829
Sample Questions
Q1) Which of the following is NOT a class used in constructing a menu system?
A) JMenuItem
B) JCheckBoxMenuItem
C) JButton
D) JRadioButtonMenuItem
To view all questions and flashcards with answers, click on the resource link above.
Page 15
Chapter 14: Applets and More
Available Study Resources on Quizplus for this Chatper
54 Verified Questions
54 Flashcards
Source URL: https://quizplus.com/quiz/34828
Sample Questions
Q1) An applet using a Swing GUI is extended from this class.
A) JFrame
B) JLabel
C) JSwing
D) JApplet
Q3) If a frame component is 300 pixels wide and 200 pixels high, the upper, right-hand
corner has (X, Y) coordinates of:
A) (0, 0)
B) (300, 0)
C) (200, 300)
D) (299, 0)
Q4) The delay parameter in the Timer constructor is the amount of time between action
events, measured in microseconds.
A)True
B)False
To view all questions and flashcards withPage 16 click on the resource link above.
answers,
Chapter 15: Creating GUI Applications With Javafx and
Scene Builder
Available Study Resources on Quizplus for this Chatper
40 Verified Questions
40 Flashcards
Source URL: https://quizplus.com/quiz/34827
Sample Questions
Q1) This section of the Inspector Panel allows you to register the controller class and
event listeners with the GUI.
A) Code
B) Properties
C) Layout
D) Content
Q2) 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
Q3) In the controller class, you can use the RadioButton's ________ method to
determine whether the RadioButton is selected or not.
A) isChecked
B) isPushed
C) isSelected
D) getIndex
To view all questions and flashcards with answers, click on the resource link above.
Page 17
Chapter 16: Recursion
Available Study Resources on Quizplus for this Chatper
42 Verified Questions
42 Flashcards
Source URL: https://quizplus.com/quiz/34826
Sample Questions
Q1) Look at the following pseudocode algorithm: Algorithm Test3(int a, int b)
If (a < b)
Return 5
Else if ( a == b)
Return -5;
Else
Return (a + Test3(a - 1, b)
End Test3
What is the base case for the algorithm?
A) a < b
B) a == b
C) Both A and B
D) neither A nor B
Q2) Like ________, a recursive method must have some way to control the number of
times it repeats.
A) a loop
B) any method
C) a class constructor
D) an event
To view all questions and flashcards with answers, click on the resource link above.
Page 18
Chapter 17: Databases
Available Study Resources on Quizplus for this Chatper
48 Verified Questions
48 Flashcards
Source URL: https://quizplus.com/quiz/34825
Sample Questions
Q1) To what package does the Connection interface belong?
A) java.swing
B) java.awt
C) java.sql
D) java.io
Q3) 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
To view all questions and flashcards with answers, click on the resource link above.
Page 19