Fundamentals of Computing Mock Exam - 953 Verified Questions

Page 1


Fundamentals of Computing

Mock Exam

Course Introduction

Fundamentals of Computing introduces students to the essential concepts, principles, and practices that form the basis of computer science. The course covers topics such as computer hardware and software, algorithms, data representation, programming concepts, operating systems, networking, databases, and the social and ethical implications of computing. Through hands-on exercises and practical projects, students gain foundational skills in problem-solving, logical thinking, and computational reasoning, preparing them for further studies in the field and equipping them with the digital literacy needed for various academic and professional pursuits.

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) Application software refers to programs that make the computer useful to the user.

A)True

B)False

Answer: True

Q2) The contents of a variable cannot be changed while the program is running.

A)True

B)False Answer: False

Q3) A program is a sequence of instructions stored in:

A) The CPU

B) The computer's memory

C) Software

D) Firmware Answer: B

Q4) Each byte is assigned a unique number known as an address.

A)True

B)False

Answer: True

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) What is the result of the following expression? 25 - 7 * 3 + 12 / 3

A) 6

B) 8

C) 10

D) 12

Answer: B

Q2) What is the result of the following expression? 25 / 4 + 4 * 10 % 3

A) 19

B) 5.25

C) 3

D) 7

Answer: D

Q3) Which of the following statements correctly creates a Scanner object for keyboard input?

A) Scanner kbd = new Scanner(System.keyboard);

B) Scanner keyboard(System.in);

C) Scanner keyboard = new Scanner(System.in);

D) Keyboard scanner = new Keyboard(System.in);

Answer: C

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

Page 4

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) This type of operator determines whether a specific relationship exists between two values:

A) Logical

B) Mathematical

C) Unary

D) Relational

Answer: D

Q2) Unicode is an international encoding system that is extensive enough to represent ALL the characters of ALL the world's alphabets.

A)True

B)False

Answer: True

Q3) What does the following code display?

Double x = 12.3798146; System.out.printf("%.2f\n", x);

A) 123798146

B) 1238

C) %12.38

D) 12.38

Answer: D

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) This type of loop allows the user to decide the number of iterations.

A) Counter-controlled loop

B) Dynamically executed loop

C) User controlled loop

D) Infinite loop

Q2) How many times will the following do-while loop be executed? int x = 11;

Do

{

X += 20;

} while (x > 100);

A) 0

B) 1

C) 4

D) 5

Q3) The increment operator is:

A) ++

B) --

C) *=

D) -=

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) Which of the following is NOT a benefit derived from using methods in programming?

A) Pproblems are more easily solved.

B) simplifies programs

C) code reuse

D) All of the above are benefits.

Q2) Which of the following is NOT a part of the method header?

A) return type

B) method name

C) parentheses

D) semicolon

Q3) The expression in a return statement can be any expression that has a value.

A)True

B)False

Q4) When writing the documentation comments for a method, you can provide a description of each parameter by using a:

A) @comment tag

B) @doc tag

C) @param tag

D) @return tag

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) Which of the following is NOT involved in finding the classes when developing an object-oriented application?

A) Describe the problem domain.

B) Identify all the nouns.

C) Write the code.

D) Refine the list of nouns to include only those that are relevant to the problem.

Q2) A class in not an object, but a description of an object.

A)True

B)False

Q3) Instance methods do not have this key word in their headers:

A) public

B) static

C) private

D) protected

Q4) Shadowing is the term used to describe where the field name is hidden by the name of a local or parameter variable.

A)True

B)False

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) What would be the results of the following code? int[] array1 = new int[25]; // Code that will put values in array1

Int value = array1[0];

For (int a = 1; a < array1.length; a++)

{ If (array1[a] < value)

Value = array1[a];

}

A) value contains the highest value in array1

B) value contains the lowest value in array1

C) value contains the sum of all the values in array1

D) value contains the average of the values in array1

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

A)True

B)False

Q3) Declaring an array reference variable does not create an array.

A)True

B)False

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

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) If a class has a method named finalize, it is called automatically just before an instance of the class is destroyed by the garbage collector.

A)True

B)False

Q2) A static field is created by placing:

A) the key word static after the field name

B) the key word static after the access specifier and before the field's data type

C) the key word static after the access specifier and field's data type

D) it in a static field block

Q3) If the this variable is used to call a constructor:

A) a compiler error will result, if it is not the first statement of the constructor

B) a compiler error will result, if it is the first statement of the constructor

C) nothing will happen

D) the this variable cannot be used as a constructor call

Q4) You can declare an enumerated data type inside of a method.

A)True B)False

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

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) If your program needs to make a lot of changes to one or more string, you might consider using objects of this class:

A) Character

B) String

C) StringBuilder

D) All of the above

Q2) Use the following import statement when using the Character wrapper class:

A) import java.Char

B) import java.lang.Char

C) import java.String

D) No import statement is needed

Q3) What will be the value of loc after the following code is executed? Int loc;

String str = "The cow jumped over the moon.";

Loc = str.lastIndexOf("ov", 14);

A) 15

B) 16

C) 0

D) -1

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

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) 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

Q2) When a subclass overloads a superclass method:

A) Both methods may be called with a subclass object

B) Only the subclass method may be called with a subclass object

C) Only the superclass method may be called with a subclass object

D) Neither method may be called with a subclass object

Q3) An anonymous inner class must:

A) implement an interface

B) extend another class

C) either A or B

D) both A and B

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) When deserializing an object using the readObject method, you must cast the return value to the desired class type.

A)True

B)False

Q2) When an exception is thrown by code in the try block, the JVM begins searching the try statement for a catch clause that can handle it and passes control of the program to:

A) each catch clause that can handle the exception.

B) the last catch clause that can handle the exception.

C) the first catch clause that can handle the exception.

D) If there are two or more catch clauses that can handle the exception, the program halts.

Q3) To serialize an object and write it to the file, use this method of the ObjectOutputStream class.

A) SerializeObject

B) WriteObject

C) Serialize

D) SerializeAndWrite

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

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) Event listeners must:

A) implement an interface

B) be included in private inner classes

C) not receive any arguments

D) exit the application once it has handled the event

Q2) Programs that operate in a GUI environment must be:

A) event driven

B) in color

C) dialog boxes

D) layout managers

Q3) When a splash screen is displayed, the application does not load and execute until the user clicks the splash screen image with the mouse.

A)True

B)False

Q4) When using the BorderLayout manager, how many components can each region hold?

A) 1

B) 2

C) 5

D) No limit

Page 14

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

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) If the letter chosen as the mnemonic is in the component's text, the first occurrence of that letter will appear ________ when the component is displayed.

A) bolded

B) italicized

C) underlined

D) all of the above

Q2) In the following code the setPreferredSize method sets the size of the text, "Have a good day".

label = new Jlabel("Have a good day", SwingConstants.CENTER); label.setPreferredSize(new Dimension(400,200));

A)True

B)False

Q3) A label's preferred size is determined only by calling the setPreferredSize method. A)True

B)False

Q4) Both AWT classes and Swing classes ultimately inherit from the Component class. A)True

B)False

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) The delay parameter in the Timer constructor is the amount of time between action events, measured in milliseconds.

A)True

B)False

Q2) The following getAudioClip() method returns an object that will load the sound file and assign the location of that file to clip which can then be used to call methods that may play the sound file one or more times:

Audioclip clip = getAudioClip(getDocumentBase(), "mysound.wav");

A)True

B)False

Q3) What will happen if you use </CENTER> instead of </center> in an HTML document?

A) The tag will be ignored.

B) The text inside the tag will be centered just the same.

C) The text inside the tag will be centered and appear in all uppercase letters.

D) An exception will be thrown.

Q4) Some browsers do not directly support the Swing classes of applets.

A)True

B)False

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

Page 16

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) In the controller class, you can use the CheckBox's ________ method to determine whether the CheckBox is selected or not.

A) getIndex

B) isActive

C) isChecked

D) isSelected

Q2) This is a name that identifies a component in the FXML file and will also become a variable name that you can use later in the Java code that you will write to run the application.

A) fx:id

B) fx_id

C) FXID

D) fx.URL

Q3) In JavaFX, this component is commonly used as a GUI's root node.

A) List

B) AnchorPane

C) Button

D) ComboBox

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) 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

Q2) 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

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) This is the standard language for working with database management systems.

A) SQL

B) BASIC

C) ADA

D) COBOL

Q2) What SQL operator can be used to perform a search for a substring?

A) STR

B) LIKE

C) WHERE

D) SUB

Q3) In an entity relationship diagram, the primary keys are denoted with:

A) (PK)

B) (1)

C) (KEY)

D) (PRIME)

Q4) What SQL operator can be used to disqualify search criteria in a WHERE clause?

A) AND

B) NOT

C) EXCLUDE

D) NOR

Page 19

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

Turn static files into dynamic content formats.

Create a flipbook