AP Comp Science Sem 2 Final part 2

Ace your homework & exams now with Quizwiz!

The expression !(p | | q) is equal to ____. a. !p && !q b. !(p && q) c. !p | | !q d. | | (!p !q)

a. !p && !q

If you want the browser to display text "as is," with line breaks, extra spaces, and tabs, use the ____ tag. a. <PRE> b. <AS> c. <P> d. <BODY>

a. <PRE>

Alex uses a(n) ____ variable to break out of a loop once the presence of a particular number is found in an array. a. Boolean b. integer c. string d. parameter

a. Boolean

Which of the following is NOT an example of a technique for handling repeating sets of inputs? a. Boolean b. count c. query d. sentinel

a. Boolean

____ is like hypertext, but includes GUIs, images, sound, animation, and applications. a. Hypermedia b. Memex c. HTML d. Hyperties

a. Hypermedia

.____ give programmers access to complex behavior. a. Objects b. Aspects c. Samples d. Mutators

a. Objects

Which of the following is NOT true about applets? a. They can be used to access files on a user's machine. b. They should be placed in the same directory as the HTML documents that use them. c. Applications can be converted to applets. d. Applets present a graphical user interface.

a. They can be used to access files on a user's machine.

TEMPERATURE CONVERTER Figure 9-2 above shows an example of a(n) ____. a. applet b. table c. inline image d. associative link

a. applet

The ____ character is used in the display of 167.e+2. a. e b. g c. n d. s

a. e

The items in an array are called ____. a. elements b. values c. variables d. objects

a. elements

A(n) ____ loop visits each element in an array from the first position to the last position. a. enhanced for b. initializer c. logical d. parallel

a. enhanced for

Methods in a subclass can be related to methods in a superclass in all of the following ways EXCEPT ____. a. implementation of a concrete method. b. extension c. overriding d. finality

a. implementation of a concrete method.

Emma knows that to increase a sound clip's volume, she needs to instruct the program to ____. a. increase the size of the sample value b. decrease the amplitude c. divide the sound clip's old value by a given factor d. adjust the sound's aspect ratio

a. increase the size of the sample value

A(n) ____ assertion states what should be true before a loop is entered a. input b. output c. invariant d. variant

a. input

Ravi must indicate an array's ____ in the loop when the array is not full. a. logical size b. first value c. last value d. physical length

a. logical size

Organizing code into two classes called the ____ and the view splits the code between managing the interface and manipulating the database. a. model b. GUI c. application d. widget

a. model

A(n) ____ if statement is another word for an extended if statement. a. multiway b. nested c. two-way d. looped

a. multiway

The simplest way to add a data element to an array is to ____. a. place it after the last available item b. place it before the first available item c. increase the physical size d. increase the logical size

a. place it after the last available item

A(n) ____ method is accessible to a class's descendents, but not to any other classes in the hierarchy. a. protected b. private c. dependent d. inherited

a. protected

In general, a(n) ____ path name is easier to use because it is shorter and doesn't need to be changed when a group of documents is moved. a. relative b. absolute c. linked d. embedded

a. relative

A(n) ____ or keyed list is a data structure that allows a computer to look up an item or entry associated with a given key. a. table b. ordered c. definition d. linked

a. table

The expression p | | (q && r) is equal to ____. a. | | p && | | q b. (p | | q) && (p | | r) c. p | | q && p | | r d. p | | q| | r

b. (p | | q) && (p | | r)

Alex is trying to find the first location of a value in the array. The variable loc initially equals ____. a. null b. -1 c. 0 d. 1

b. -1

The ____ symbol on a button in a GUI interface moves to the first record in the database and displays its data. a. 1 b. << c. >> d. <

b. <<

SINGLE CAT PICTURE ____ detection was used in Figure 5-2 above to remove the full colors of the original image to uncover the outlines of the objects represented in the image. a. Line b. Edge c. Luminance d. Color

b. Edge

When a(n) ____ program opens, it sits there and waits for events such as the user clicking the mouse. a. Java b. GUI c. menu-driven d. application

b. GUI

____ provides a mechanism for reusing code and can reduce the effort required to implement a new class. a. Aliasing b. Inheritance c. Polymorphism d. Referencing

b. Inheritance

The most general type of array is one whose element type is ____. a. String b. Object c. Shape d. Int

b. Object

When a target document resides on another server in the network, use a(n) ____ to locate the document. a. file path b. URL c. host name d. <A> tag

b. URL

The method "equals (aString)" returns a(n) ____ value. a. int b. boolean c. char d. object

b. boolean

A program instantiates a class by using one of its ____ with the new operator a. variables b. constructors c. accessors d. mutators

b. constructors

The String variable ____ controls how many times a loop repeats. a. whenEnd b. doItAgain c. stopWhen d. ifEnd

b. doItAgain

Nico wants to add a(n) ____, an effect wherein an earlier part of a sound clip is heard concurrently with the sound at the present moment. a. splice b. echo c. compose d. blur

b. echo

The basic syntax for referring to an array ____ has the form <array name>[<index>]. a. length b. element c. name d. initializer

b. element

YELLOW BOXES In Figure 11-1 above, we say that AAA ____ Object. a. aliases b. extends c. aggregates d. overrides

b. extends

The Boolean variable ____ is used to break out of a loop if a particular number is in an array. a. break b. found c. stop d. true

b. found

A(n) ____ is a structure consisting of nodes and links between them. a. hypermedia b. hypertext c. HTML d. hyperlink

b. hypertext

To access the ____ cell in an array, use the expression <array>.length - 1 a. first b. last c. second to last d. None of the above

b. last

A(n) ____ loop structure visits each element in a sequence or counts through a sequence of numbers using a single loop control variable. a. nested b. linear c. single d. straight

b. linear

In HTML, codes called ____ tags indicate the format of textual elements or links to other nodes. a. format b. markup c. internal d. associative

b. markup

CONVERT FROM *F TO *C Figure 8-2 above shows the interface for a ____-controlled program. a. count b. menu c. query d. sentinel

b. menu

To use an object effectively, the programmer must know the set of ____ that it recognizes. a. classes b. methods c. parameters d. packages

b. methods

Sonja has written the program so that the current version's color panel maintains an array of shapes, which violates the ____ division of responsibilities. a. panel/array b. model/view c. object/array d. subclass/superclass

b. model/view

The printf method could be used to specify the ____ in a floating-point number. a. placement of the decimal b. number of digits to the right of the decimal point c. exponents d. value

b. number of digits to the right of the decimal point

When information is sent from an HTML page to an applet, the information is passed in HTML ____ tags. a. markup b. parameter c. associative d. external

b. parameter

An array with 20 ints that receives 5 ints from interactive input has a(n) ____ size of 20. a. actual b. physical c. logical d. variable

b. physical

In the TurtleGraphics package, the pen is initially all of the following EXCEPT ____. a. at position [0,0] b. ready to draw a square c. pointing north d. in the down position

b. ready to draw a square

GREEN TABLE Figure 7-1 above is a(n) ____. a. flowchart b. truth table c. evaluation grid d. rule table

b. truth table

A(n) ____ statement is used to detect and respond to an exception so it does not halt the program. a. if-else b. try-catch c. void d. listener

b. try-catch

In a pixel grid, the position (0, 0) is in the ____ corner of the grid. a. upper-right b. upper-left c. lower-right d. center

b. upper-left

Alex uses the main ____ class to instantiate and maintain references to the data fields and the command buttons. a. model b. view c. controller d. application

b. view

In Java, the operator NOT is represented by ____. a. && b. | | c. ! d. < >

c. !

The ____ symbol on a button in a GUI interface moves to the last record in the database and displays its data. a. [end] b. << c. >> d. <

c. >>

____ is when methods in different classes with a similar function are given the same name. a. Aliasing b. Inheritance c. Polymorphism d. Referencing

c. Polymorphism

TXT W/ BOX TO THE RIGHT In Figure 10-2 above, all of the following is true EXCEPT ____. a. The method changes the student's name to Bill. b. After the method finishes executing, the name is still Bill. c. The actual and formal parameters do not refer to the same object. d. Changes the method makes to the object's state are still in effect after the method terminates.

c. The actual and formal parameters do not refer to the same object.

A networked hypermedia system requires a uniform means of assigning node addresses using ____. a. path names b. hyperlinks c. URLs d. HTML

c. URLs

When referring to an array element, the subscript operator is ____. a. . b. { } c. [ ] d. < >

c. [ ]

The <BR> tag is used to indicate ____. a. the text should be brown b. the ideal browser version c. a manual line break d. the text should be brightened

c. a manual line break

Olive uses the tag <UL> to create a ____ list. a. definition b. numbered c. bulleted d. nested

c. bulleted

Nico wants to ____, or blend together two sound clips so that they will play simultaneously. a. splice b. echo c. compose d. blur

c. compose

Alex uses a ____ class to inform a listener attached to a button that a user has clicked it. a. model b. view c. controller d. application

c. controller

LIST IN WINDOW Figure 9-1 above shows an example of a(n) ____ list. a. ordered b. unordered c. definition d. nested

c. definition

An image basically consists of all of the following EXCEPT ____. a. width b. height c. depth d. set of pixels

c. depth

The tag for a(n) ____ is <A>. a. paragraph b. ampersand c. hyperlink d. attribute

c. hyperlink

Object ____ makes a new object available to a program a. orientation b. definition c. instantiation d. access

c. instantiation

A class's ____ provides the information needed to use the class without revealing anything about its implementation.. a. value b. definition c. interface d. hierarchy

c. interface

When related classes have the same ____, they can be used interchangeably in a program. a. value b. definition c. interface d. hierarchy

c. interface

A loop ____ is an assertion that expresses a relationship between variables that remains constant throughout all iterations of the loop. a. validation b. operator c. invariant d. variant

c. invariant

In a pixel grid, the position (width-1, height-1) is in the ____ corner of the grid. a. upper-right b. upper-left c. lower-right d. center

c. lower-right

The ____ code is used to display an octal integer. a. d b. f c. o d. x

c. o

Arrays are ____ and must be instantiated before being used. a. values b. variables c. objects d. strings

c. objects

ENTER DEGREES *F Figure 8-1 above shows the interface for a ____-controlled program. a. count b. menu c. query d. sentinel

c. query

The process of short-circuit evaluation ____. a. identifies potential run-time errors b. identifies potential logic errors c. stops the evaluation of a Boolean expression once it knows the value d. creates robust programs

c. stops the evaluation of a Boolean expression once it knows the value

A combinatorial explosion is ____. a. a type of run-time error b. what happens when the JVM throws an exception c. the multiplicative growth in test cases d. a sign that your program is not robust

c. the multiplicative growth in test cases

The ____ is responsible for displaying the data model and providing the user with visual controls for interaction. a. model b. application c. view d. controller

c. view

Ravi uses ____ to indicate an initializer list. a. [ ] b. < > c. { } d. ( )

c. { }

Marta precedes letters such as d, s, and n with the ____ character. a. & b. * c. # d. %

d. %

Use the ____ operator to wrap the direction of a moving object if it is greater than 360 degrees. a. + b. > c. | | d. %

d. %

The ____ flag is used for left justification. a. , b. l c. < d. -

d. -

A pixel contains integer values that represent its color in terms of ____ components a. PPI b. aspect c. height and width d. RGB

d. RGB

A(n) ____ object can be used to read words from a string. a. substring b. char c. reader d. Scanner

d. Scanner

Which of the following is NOT true about Vannevar Bush's predictions? a. By the 1950s and 60s they were coming true. b. Each machine would receive chunks of information from a photocopy machine, keyboard, or stylus. c. The computer would maintain traces of the user's explorations of associative links. d. The information would be stored on magnetic tape.

d. The information would be stored on magnetic tape.

CAT PICTURES The image to the right in Figure 5-1 above has ____ a. been converted to black and white b. had its brightness adjusted c. had its edges detected d. been converted to grayscale

d. been converted to grayscale

An item's position within an array is called its ____. a. index b. subscript c. path d. both a and b are true.

d. both a and b are true.

To compare objects for equality, use the ____. a. = = operator b. equals method c. compare operator d. both a and b are true.

d. both a and b are true.

Marta must match format specifiers in a format string to expressions following the string in ____. a. type b. position c. value d. both a. and b

d. both a. and b

The ____ is a set of classes that are listeners. a. model b. application c. view d. controller

d. controller

The inputs to an echo algorithm are a sound clip and an integer ____ a. coordinate b. value c. variable d. delay

d. delay

All the sets of test data that exercise a program in the same manner belong to the same ____ class. a. assurance b. boundary c. logical d. equivalence

d. equivalence

In a string of three two-digit hexadecimal numbers used to specify a color, the second two digits represent the ____ components. a. blue b. red c. yellow d. green

d. green

A(n) ____ image is a graphical image that displays when the user opens a page. a. thumbnail b. embedded c. external d. inline

d. inline

Jinling is testing statements, so she wants to formulate all of the following EXCEPT ____. a. equivalence classes b. boundary conditions c. extreme conditions d. input assertions

d. input assertions

If you want to keep a list of peoples' names and ages, you can use two arrays in which corresponding elements are related by using ____ arrays. a. logical b. double c. duplicate d. parallel

d. parallel

The ____ method is used to apply formatting. a. formatchar b. println c. enhancetext d. printf

d. printf

When the element type of an array is a(n) ____ or interface, objects of those types or any subtype can be directly inserted into the array. a. primitive b. concrete c. abstract d. reference

d. reference

The ____ character is used in the display of a string. a. e b. g c. n d. s

d. s

Geraldo adds a link to another Web site using the following format: http://____/document path name. a. file name b. file extension c. URL d. server name

d. server name

One way to enforce preconditions is to ____. a. use comments b. declare them c. use inheritance d. throw an exception

d. throw an exception

A loop ____ is an assertion whose truth changes between the first and final execution of the loop. a. validation b. mutator c. invariant d. variant

d. variant

The value of a class constant is assigned ____. a. during execution b. based on user input c. based on inheritance d. when the variable is declared

d. when the variable is declared


Related study sets

ISEC Chapter 10 Practice Questions

View Set

Ch.10 Preparing Effective Visual Aids

View Set

BIOL220 Development: Reproduction

View Set

Chp 20 Financing the Real Estate Transaction

View Set

翰林-104(下)-BOOK 2-文法選擇(第三次月考) $$$

View Set