Computer Programming and CAD

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

D. ; (semicolon)

A C+ statement must end in a ___. A. : (column) B. , (comma) C. . (period) D. ; (semicolon)

C. console application

A C++ ______ is a program that runs In a DOS window. A. algorithm B. cast application C. console application D. source application

B. field

A ____ is a single item of information about a person, place, or thing. A. data file B. field C. program file D. record

D

"C++" is a _____ constant A. character literal B. named literal C. numeric literal D. string literal

A. inspector functions

Functions that returns information about an object's state can be classified as ____. A. inspector functions B. mutator functions C. auxiliary functions D. manager functions

A

Header files often have the file extension _____ A. .H B. .HE C. .HEA D. .HEAD

D

How many instances of an abstract class can be created? A. 1 B. 5 C. 13 D. 0

D

An array element is accessed using A. a first-in-first-out approach B. the dot operator C. a member name D. an index number

C

An array name is a _____. A. subscript B. formal parameter C. memory address D. prototype

C. performs an action or service

An auxiliary function _____. A. return information about data members B. changes the state of data members C. performs an action or service D. creates and destroys objects

B

An expression contains relational, assignment and arithmetic operators. In the absence of parentheses, the order of evaluation will be A. assignment, relational, arithmetic B. arithmetic, relational, assignment C. relational, arithmetic, assignment D. assignment, arithmetic, relational

C

An object is ______ A. a category of classes B. a name given to a class C. an instance of a class D. the same as a class

C

Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified? A. Cali by value B. Call by reference C. Default arguments D. Call by pointer

C. sequence

Which of the following control structures is used in every program? A. repetition B. selection C. sequence D. switching

A. diamond

Which of the following flowchart symbols represents the if selection structure? A. diamond B. hexagon C. oval D. parallelogram

C. code the algorithm

Which of the following is the fourth problem-solving step? A. analyze the problem B. evaluate and modify (if necessary) the program C. code the algorithm D. plan the algorithm

C

Which of the following is true? A. iostream is derived from istream B. iostream is derived from ostream C. ostream is derived from iostream D. ostream is derived from istream

A

Which of the following is(are) invalid string constant(s)? A. '7.15 pm' B. "I like e" C. "7.3el2" D. "1234e12"

A. call

You invoke a function with a function A. call B. declaration C. definition D. prototype

D

You typically initialize a String variable to ____. A. an asterisk B. a space enclosed in single quotes C. the number 0 D. a zero-length string

C. Debugging

______ refers to the process of locating and removing the errors in a program. A. Analyzing B. Correcting C. Debugging D. Executing

A. an algorithm

The step-by-step instructions that solve a problem are called _____. A. an algorithm B. a list C. a plan D. a sequential structure

D. heap

The store of memory available to programs is the A. store B. stack C. pile D. heap

A

The string "HELLO WORLD° needs A. 11 bytes B. 12 bytes C. 10 Bytes D. 8 bytes

C

The two operators && and || are A. arithmetic operators B. equality operators C. logical operators D. relational operators

D. header and body

The two parts of a function are the A. header and footer B. declarations and statements C. legs and feet D. header and body

A

The weakest form of cohesion is A. coincidental B. functional C. logical D. communicational

C. pretest

The while loop is referred to as a(n) ____ loop because the loop condition is tested at the beginning of the loop. A. beginning B. initial C. pretest D. priming

B

Which of the following assigns the number 5 to the area variable? A. area 1 = 5 B. area = 5 C. area == 5 D. area --> 5

D. displayName();

Which of the following calls a function named displayName, passing it no actual arguments? A. call displayName; B. call displayName (); C. displayName; D. displayName();

C. void main()

Which of the following can be used to declare the main function? A. void main B. void Main() C. void main() D. main

A. a class

A blueprint for creating an object in C++ is called _____. A. a class B. an instance C. a map D. a pattern

D

A comment _____ A. is a note that can be put into the source code B. is ignored by the compiler. C. starts with the /* character pair D. All of the above

A

A derived class may also be called a A. subclass B. super class C. parent class D. base class

D

A function can A. return a value B. perform a task C. change value of actual arguments in call by reference D. a, b, c above are all true

B

A function that is called automatically each time an object is destroyed is a A. constructor B. destructor C. destroyer D. terminator

B

A function that returns no values to the program that calls it is A. not allowed in C++ B. type void C. type empty D. type barren

A

A function whose purpose is to send messages to other functions is known as a _____. A. dispatcher B. courier C. messenger D. sender

D

A fundamental type such as int or double is a ____. A. programmer-defined type B. complex type C. nonscalar type D. scalar type

B

A measure of the strength of the connection between two functions is A. cohesion B. coupling C. dependence D. subjection

A

A pattern for creating an object is called a(n) _____ A. class B. attributes C. private D. public

C. procedural

A program that predicts the exact sequence in which events will take place is said to be _______. A. compiled B. interpreted C. procedural D. object-oriented

B. a memory location whose value can change while the program is running

A variable is _____. A. an item of data B. a memory location whose value can change while the program is running C. a memory location whose value cannot change while the program is running D. a collection of items

B. counter, accumulator

A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies A. accumulator, counter B. counter, accumulator C. adder, counter D. accumulator, adder

B

Evaluate the following expression: 3>6&&7>4 A. True B. False C. Invalid D. Can't determine

A

Evaluate the following expression: 4>6||10<2*6 A. True B. False C. Invalid D. Can't determine

A

Evaluate the following expression: 7>=3+4||6<4&&2<5 A. True B. False C. Invalid D. Can't determine

B

Files whose names end in .h are called ______ files A. handy B. header C. helper D. helping

B

Inheritance is the principle that A. classes with the same name must be derived from one another B. knowledge of a general category can be applied to more specific objects C. C++ functions may be used only if they have logical predecessors D. one function name may invoke different methods

C. the 0s and 1s that the computer can understand

Machine code is _____. A. edited code B. source code C. the 0s and 1s that the computer can understand D. both (b) and (c)

C

Object is to class as _______ A. library is to book B. mother is to daughter C. Plato is to philosopher D. president is to Lincoln

A

Precedence determines which operator A. is evaluated first B. is most important C. is fastest D. operates on the largest number

A. class member functions

Private data can be accessed by A. class member functions B. functions in derived classes C. both (a) and (b) D. neither (a) nor (b)

C

The C++ operator used to allocate memory is _____ A. mem B. allocate C. new D. create

A

The String data type is an extension of the _____ data type A. Character B. Double C. Letter D. Long

C

The best form of coupling is ____ A. complete B. tight C. loose D. free

B

The best functions have ____ A. high cohesion and tight coupling B. high cohesion and loose coupling C. low cohesion and tight coupling D. low cohesion and loose coupling

B

The bitwise OR operator is a A. unary operator B. binary operator C. ternary operator D. octal operator

C. curly brackets

The body of a C++ function is surrounded by ____. A. parentheses B. angle brackets C. curly brackets D. square brackets

D. source code

The code that you enter into a C++ program is called _____. A. console code B. object code C. project code D. source code

B. object code

The compiler converts your C++ instructions into ____. A. edited code B. object code C. source code D. translated code

D

The dot operator (or class member access operator) connects the following two entities (reading from left to right): A. a class member and a class object B. a class object and a class C. a class and a member of that class D. a class object and a member of that class

B

The element of an array is A. the name of the array B. a member of an array C. a value assigned to an array D. All of the above

A

The end of string is recognized by ______ A. the null character B. the first character in the string C. the length of the string D. the name of the array holding the string

B

The first element in a string is ____. A. the name of the string B. the first character in the string C. the length of the string D. the name of the array holding the string

A

The following statement where T is true and F is false T&&T||F&&T A is true B. is false C. is wrong D. not applicable in C language

B

The functions go in the ____ section of a class definition. A. declaration B. implementation C. prototype D. functioning

A

The highest level of cohesion is A. functional cohesion B. temporal cohesion C. logical cohesion D. sequential cohesion

C. selection

The instruction "If it's raining outside, then take an umbrella to work" is an example of the ____ structure. A. control B. repetition C. selection D. sequence

C

The keyword used to define a structure is _____ A. stru B. st C. struct D, structure

A. return

The last statement in a function is often a(n) _____. A. return B. Goodbye C. finish D. endfunction

D. return expression;

The last statement in a value-returning function is always ______. A. }; B. result expression; C. return; D. return expression;

A. diamond

The loop condition in a flowchart is represented by a(n) _____. A. diamond B. oval C. parallelogram D. rectangle

A

The loosest type of coupling is A. data coupling B. control coupling C. external coupling D. pathological coupling

B

The measure of how well the operations in a function relate to one another is _____ A. coupling B. cohesion C. adhesion D. conversion

A

The most efficient data type for a variable that stores the letter C is the ____ data type. A. Character B. Double C. Float D. Long Integer

C. parenthesis

The name of a function ends with A. double quotes B. single quotes C. parenthesis D. #

C

The number 5.5e3 is a _____ constant. A. character literal B. named literal C. numeric literal D. string literal

C

The operator that releases previously allocated memory is _______. A. release B. return C. delete D. destroy

C. abstraction

The process of extracting the relevant attributes of an object is known as: A. polymorphism B. inheritance C. abstraction D. data hiding

A. syntax

The rules to any programming language are its _____. A. syntax B. interpretation C. logic D. customs

D. sequence

The set of instructions for how to tie a bow is an example of the _____ structure A. control B. repetition C. selection D. sequence

B

The statement double total = 0.0; performs ____. A. assignment B. initialization C. rationalization D. polymorphism

C

To be called object-oriented, a programming language must allow A. functions that return only a single value B. #include files C. inheritance D. All of the above

D. both (a) and (c)

To create and execute a C++ program, you need to have access to ____. A. a C++ compiler B. a C++ translator C. a text editor D. both (a) and (c)

D

To enter a comment in a C++ program, you begin the comment with _____. A. ** B. && C. \\ D: //

B. compiling

To execute a C++ program, you first need to translate the source code into object code. This process is called ____. A. coding B. compiling C. sourcing D. translating

D

To use one of the C++ built-in mathematical functions, you must include the ____ header file in your program A. calculation.h B. compute.h C. expression.h D. math.h

A. public and private

Two access specifiers in C++ are A. public and private B. int and double C. formal and informal D. void and free

D. a syntax error

Typing the function's name as Main, rather than main, is an example of: A. an entry error B. a function error C. a logic error D. a syntax error

D. an underscore (_)

Which of the following are valid characters for a numeric literal constant? A. a comma (.) B. a dollar sign ($) C. a percent sign (%) D. an underscore (_)

C

When a function performs tasks based on a decision, it has ______ A. functional cohesion B. coincidental cohesion C. logical cohesion D. no cohesion

B. record

When variables refer to attributes of an entity (such as name, address, and phone number of a person), those attributes form a ____. A. file B. record C. field D. program

B

Which is true? A. Coincidental cohesion is stronger than procedural cohesion B. Logical cohesion is stronger than coincidental cohesion C. Sequential cohesion is weaker than temporal cohesion D. The weakest cohesion is functional

B

Which of the following term is used for a function defined inside a class? A. Member Variable B. Member function C. Class function D. Classic function

C

Which of the following type of class allows only one object of it to be created? A. Virtual class B. Abstract class C. Singleton class D. Friend class

C. amt_Sold

Which of the following, if any, are valid names for variables? A. amt. Sold B. amt-Sold C. amt_Sold D. 98Sold

C. denial

Which type of statement does not occur in computer programs? A. sequence B. loop C. denial D. selection

A

function that is called automatically each time an object is created is a(n) _____. A. constructor B. contractor C. builder D. architect


Kaugnay na mga set ng pag-aaral

Test on the chemical bonding unit

View Set

Cardiac/Respiratory Practice Questions

View Set

Chapter 23 Legal Implications in Nursing Practice

View Set