Skip to main content

Computer Science I Study Guide Questions - 1208 Verified Questions

Page 1


Computer Science I Study Guide Questions

Course Introduction

Computer Science I is an introductory course designed to provide students with a foundational understanding of computer science principles and programming. The course covers essential topics such as problem-solving techniques, algorithm development, basic data structures, and the syntax and semantics of a modern programming language (such as Python or Java). Students will learn to write, test, and debug simple programs, as well as develop logical thinking and computational skills necessary for further study in the field. Emphasis is placed on hands-on programming assignments and practical applications of computing concepts.

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) The rules for the programming language

A)literal string

B)high-level programming languages

C)dialog box

D)syntax

E)whitespace

F)compiler

G)attributes

H)Machine language

I)Java virtual machine (JVM)

Answer: D

Q2) Line comments start with ____.

A) a forward slash and an asterisk

B) two forward slashes

C) a forward slash and two asterisks

D) a percent sign

Answer: B

Q3) In programming, named computer memory locations are called ____________________ because they hold values that might vary.

Answer: variables

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) Describe the variation types byte, short, and long of the integer type.

Answer: The types byte, short, and long are all variations of the integer type. The byte and short types occupy less memory and can hold only smaller values; the long type occupies more memory and can hold larger values.

Q2) Describe and give an example of operator precedence.

Answer: Operator precedence refers to the rules for the order in which parts of a mathematical expression are evaluated. The multiplication, division, and remainder operators have the same precedence. Their precedence is higher than that for the addition and subtraction operators. Addition and subtraction have the same precedence. In other words, multiplication, division, and remainder always take place from left to right prior to addition or subtraction in an expression. For example, the following statement assigns 14 to result: int result = 2 + 3 * 4;.

Q3) The legal integer values are -2³¹ through 2³¹-1. These are the highest and lowest values that you can store in four bytes of memory, which is the size of an int variable. A)True

B)False

Answer: True

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) Assigning ____ to a field means that no other classes can access the field's values.

A) user rights

B) protected access

C) key access

D) private access

Answer: D

Q2) ____ is the encapsulation of method details within a class.

A) An interface

B) A calling method

C) Implementation hiding

D) Instantiation

Answer: C

Q3) ____ parameters are variables in a method declaration that accept the values from the actual parameters.

A) System

B) Formal

C) Public

D) Static

Answer: B

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) What is the difference between class variables and instance variables?

Q2) The compiler determines which version of a method to call by the method's ____. A) name

B) signature

C) output

D) constructor

Q3) Describe and provide an example of overloading.

Q4) int aMethod(int x) void aMethod(int x)

In the above statements, explain why these two methods are illegal in the class.

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

Q6) An alternative to importing a class is to import an entire package of classes. A)True

B)False

Q7) Describe the impact that blocks and methods have on variables with the same name.

Q8) 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) You write pseudocode in everyday language, not the syntax used in a programming language.

A)True

B)False

Q2) ____________________ is a tool that helps programmers plan a program's logic by writing plain English statements.

Q3) Two ampersands

A)relational operator

B)conditional operator

C)Boolean values

D)equality

E)switch statement

F)pipes

G)dual-alternative

H)!

I)AND operator

Q4) Computers contain switches that are set to on or off.

A)True

B)False

Q5) Why do programmers use pseudocode?

Page 7

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

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 technique of combining two loops into one

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) Loop control variables can be evaluated at the start or the end of the loop. Describe both pretest loops and posttest loops. How do do while loops execute?

Q3) When loops are nested, each pair contains a(n) ____________________ loop and an outer loop.

Q4) Describe how a loop is controlled by a Boolean expression.

Q5) A(n) ____________________ is a body with no statements in it.

Q6) Describe the purpose of a loop control variable. How are Boolean values and a while loop involved?

Q7) The ____________________ loop is the posttest loop used in Java.

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) myCounty = " Clark Jackson Scioto" myCounty.charAt(6)

Using the above code, what will be the value of the charAt() method once the code executes? Explain how the charAt() method operates.

Q2) Determines whether a specific character occurs within a String

A)parseDouble()

B)toLowerCase()

C)substring()

D)String variable

E)append()

F)buffer

G)setLength()

H)indexOf()

I)insert()

Q3) String firstCompare = "Oak Maple Pine"

String secondCompare = "spruce maple elm" firstCompare.regionMatches(false, 4, secondCompare, 7, 5)

Using the above code, what will be the Boolean value after execution of the regionMatches statement? Explain how the Strings are compared using the regionMatches() method.

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) Primitive type variables are always passed by ____.

A) value

B) reference

C) location

D) memory

Q2) Why is the length field a good option when writing a loop that manipulates an array? What programming error is common when attempting to use length as an array method?

Q3) When you perform a ____, you compare a value to the endpoints of numerical ranges to find the category in which a value belongs.

A) range match

B) sort

C) reference

D) search

Q4) How can you use the enhanced for loop?

Q5) What is a subscript and how are the array's elements numbered?

Q6) int[] sixNumbers = {1, 2, 3, 4};

The above code creates an array named sixNumbers. Describe how array sizes are determined when using an initialization list and how memory is assigned.

Page 10

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

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) How can you sort arrays of objects?

Q2) The negative integer returned by the binarySearch() method when the value is not found is the negative equivalent of the array ____.

A) type

B) scope

C) size

D) length

Q3) int[] myVals = {2, 4, 6, 8} Using the above four-element array, what is the value of myVals[1]?

A) 2

B) 4

C) 6

D) 8

Q4) When mathematicians use a two-dimensional array, they often call it a ____.

A) grid

B) net

C) matrix

D) mesh

Q5) How can you use the length field with a two-dimensional array?

Q6) What is sorting and how are objects organized as a result of being sorted?

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) A static method cannot be overridden in a subclass.

A)True

B)False

Q2) What does polymorphism mean in Java programming?

Q3) By convention, a class diagram contains the ____ following each attribute or method.

A) data field

B) argument

C) data type

D) class

Q4) The classes you create in ____________________ programming languages can inherit data and methods from existing classes.

Q5) A class diagram consists of a rectangle divided into three sections.

A)True

B)False

Q6) How are real-life examples of inheritance similar to object-oriented programming inheritance?

Q7) What is information hiding and how is it used?

Page 12

Q8) When you instantiate an object that is a member of a subclass, how many constructors are called?

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

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) While a class can inherit from any abstract superclass, it can only implement one interface.

A)True

B)False

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

Q3) Classes, such as the String class, have their own equals() methods that overload the ____ class method.

A) Object

B) Public

C) Abstract

D) Child

Q4) It is common to create an interface when you want a class to implement behavior from more than one parent.

A)True

B)False

Q5) When you create classes for others to use, why would you not want to provide the users with your source code in the files with .java extensions?

Q6) What are the three ways in which you can compare abstract classes and interfaces?

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) When a program contains multiple catch blocks, how are they handled?

Q2) To use a method to its full potential, you must know the method name, return type, type and number of arguments required, and type and number of exceptions the method throws.

A)True

B)False

Q3) The ____ class represents more serious errors from which your program usually cannot recover.

A) Error

B) Throwable

C) Exception

D) Menu

Q4) Which of the following is NOT a component of a try block?

A) a closing curly brace

B) the keyword try

C) executable statements

D) a throw statement

Q5) The memory location known as the ____________________ is where the computer stores the list of method locations to which the system must return.

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) After you create a FileSystem object, you can define a Path using the ____ method with it.

A) getPath()

B) createPath()

C) setPath()

D) getDefault()

Q2) The main directory of your storage device

A)batch processing

B)root

C)buffer

D)flushing

E)stream

F)System.getProperty("line.separator")

G)data file

H)close the files

I)BufferedWriter

Q3) How can you categorize files by the way they store data?

Q4) In random access files, records can be retrieved directly in any order.

A)True

B)False

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) How have user interface components changed since the early versions of Java?

Q2) When constructing a Font object, which of the following arguments is NOT required?

A) typeface

B) style

C) weight

D) point size

Q3) Assume you have declared a JFrame named welcomeFrame. Write the statement to set the welcomeFrame object's size to 300 pixels horizontally by 110 pixels vertically. Create a second statement to set the JFrame's title to display the text "My Sized Frame".

Q4) A method that executes because it is called automatically when an appropriate event occurs is an event ____.

A) responder

B) listener

C) handler

D) source

Q5) A(n) ____________________ consists of a label positioned beside a square; you can click the square to display or remove a check mark.

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

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) Layout managers are interface classes that align components to prevent crowding or overlapping.

A)True

B)False

Q2) When do you need to worry about using the getContentPane() method?

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

Q4) You use the getModifiers() method with an InputEvent object, and you can assign the return value to a(n) ____ variable.

A) String

B) boolean

C) int

D) double

Q5) What are the four methods defined in the Component class for adding event listeners?

Q6) What is a mnemonic? Provide an example of adding a mnemonic.

Q7) How would you arrange columns into equal rows and columns? Provide an example.

Page 17

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

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) Returns the number of pixels as an integer

A)fill pattern

B)GREEN

C)acyclic gradient

D)3D method

E)Line2D.Float class

F)fillPolygon()

G)getScreenResolution()

H)GeneralPath

I)descent

Q2) Draws a solid shape

A)fill pattern

B)GREEN

C)acyclic gradient

D)3D method

E)Line2D.Float class

F)fillPolygon()

G)getScreenResolution()

H)GeneralPath

I)descent

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) The ____ provides image-manipulation capabilities.

A) Java Speech API

B) Java Media Framework (JMF)

C) Java 3D API

D) Java Advanced Imaging API

Q2) <html>

</object> </html>

Using the HTML code above, write the statement to run a JApplet named JHello. The applet will be 450 pixels wide by 150 pixels tall.

Q3) It is common practice for programmers to write their own stop() and destroy() methods.

A)True

B)False

Q4) What are the methods of the applet life cycle?

Q5) Describe the two methods for running an applet.

Q6) How is an applet like a Java application?

Q7) How do you view an applet?

Q8) What are the three object tag attributes commonly used to run an applet?

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