0% found this document useful (0 votes)
20 views19 pages

Programming Logic and Design MCQ PDF

The document is a comprehensive guide on Programming Logic and Design, covering fundamental concepts in computer programming and problem-solving across 17 chapters. It includes 953 verified questions and flashcards to aid learning, focusing on logical thinking, algorithms, flowcharts, and pseudocode. The recommended textbook is 'Starting Out with Java From Control Structures through Objects 6th Edition' by Tony Gaddis.

Uploaded by

een7xgibr9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views19 pages

Programming Logic and Design MCQ PDF

The document is a comprehensive guide on Programming Logic and Design, covering fundamental concepts in computer programming and problem-solving across 17 chapters. It includes 953 verified questions and flashcards to aid learning, focusing on logical thinking, algorithms, flowcharts, and pseudocode. The recommended textbook is 'Starting Out with Java From Control Structures through Objects 6th Edition' by Tony Gaddis.

Uploaded by

een7xgibr9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Programming Logic and Design

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

techniques used in computer programming and problem-solving. The course

emphasizes the development of logical thinking skills and the use of structured

approaches to solving problems using algorithms, flowcharts, and pseudocode.

Students will learn how to analyze problems, break them down into manageable

components, and design step-by-step solutions before translating these solutions into

code. Topics covered include control structures, data structures, input/output

processing, modular design, and debugging strategies, providing a solid foundation for

further studies in programming and software development.

Recommended Textbook
Starting Out with Java From Control Structures through Objects 6th Edition by Tony Gaddis

Available Study Resources on Quizplus


17 Chapters
953 Verified Questions
953 Flashcards
Source URL: https://quizplus.com/study-set/1747

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

Q2) Computer programming is:


A) An art
B) A science
C) Both of the above
D) neither of the above
Answer: C

Q3) This is a special language used to write computer programs.


A) Programming language
B) Operating system
C) Application
D) Pseudocode
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
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

Q2) What does the following code display?


Int d = 9, e = 12;
System.out.printf("%d %d\n", d, e);
A) %d %d
B) 9 12
C) %d 9
D) %9 %12
Answer: B

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

Q2) What is wrong with the following method call?


DisplayValue (double x);
A) There is nothing wrong with the statement.
B) displayValue will not accept a parameter.
C) Do not include the data type in the method call.
D) x should be a String.

Q3) Local variables:


A) are hidden from other methods
B) may have the same name as local variables in other methods
C) lose the values stored in them between calls to the method in which the variable is
declared
D) All of the above

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

Q3) What does the following UML diagram entry mean?


+ setHeight(h : double) : void
A) this is a public attribute named Height and is a double data type
B) this is a private method with no parameters and returns a double data type
C) this is a private attribute named Height and is a double data type
D) this is a public method with a parameter of data type double and does not return a
value

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

Q2) In memory, an array of String objects


A) consists of elements, each of which is a reference to a String object.
B) is always implemented as a ragged array.
C) consists of elements, each of which is a String object.
D) must be initialized when the array is declared.

Q3) Java does not limit the number of dimensions that an array may have.
A)True
B)False

Q4) The sequential search algorithm:


A) requires the array to be ordered
B) must always be implemented as a method
C) uses a loop to sequentially step through an array, starting with the first element
D) will not execute, if the element is not in the array

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

Q2) 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 must be the last statement in the constructor making the call
C) it can be anywhere in the constructor making the call
D) you cannot use the this variable in a constructor call

Q3) Static methods can only operate on ________ fields.


A) instance
B) static
C) global
D) local

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

Q3) Look at the following code: Integer myNumber = new Integer(5);


Int var = myNumber;
Which of the following is TRUE about the second statement?
A) It results in an error because you cannot assign a wrapper class object to a primitive
variable.
B) The statement performs autoboxing.
C) The statement performs unboxing.
D) The statement performs unwrapping. Page 11

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.

Q2) In a class hierarchy:


A) the more general classes are toward the bottom of the tree and the more specialized
are toward the top
B) the more general classes are toward the top of the tree and the more specialized are
toward the bottom
C) the more general classes are toward the left of the tree and the more specialized are
toward the right
D) the more general classes are toward the right of the tree and the more specialized
are toward the left

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

Q4) The System.exit method will end the application.


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

Q2) What will the following code do when it is executed?


JTextArea message = JTextArea(greetings, 50, 70);
JScrollPane scrollPane = new JScrollPane(message);
A) It will create a JScrollPane object for the JTextArea object referenced by message and
display a horizontal scroll bar on the text area.
B) It will create a JScrollPane object for the JTextArea object referenced by message and
display a vertical scroll bar on the text area.
C) It will create a JScrollPane object for the JTextArea object referenced by message and
display both vertical and horizontal scroll bars on the text area.
D) It will create a JScrollPane object for the JTextArea object referenced by message and
display no scroll bars on the text area.

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

Q2) Hypertext can contain:


A) a Java application program
B) exception methods
C) executable code
D) a link to another Web page

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

Q2) In a transaction, all updates to database must be successfully executed.


A)True
B)False

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

Q4) What term refers to data that describes other data?


A) Pseudo-data
B) Micro data
C) Abstract data
D) Meta data

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

Page 19

You might also like