programming 1-60

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

dim parent as boolean = false dim mother as boolean = false dim brother as boolean = false dim salutation as string = "hello!" what will the value of the variable salutation be?

"hey sis!"

Dim i as integer = 0 dim x as integer = 0 for i = 1 to 9 step 3 x = i*2 next what is the value of x when the code has executed?

14

the following integers are added to a stack in this order: 3,8,4,6,1. you perform the following operations on the stack: *push 7 *pop *push 2 what is at the bottom of the stack after you preform these operations?

3

what is the value of x when the code has executed?

3

the following integers are added to a stack in this order: 4,7,9,2,6. you perform the following operations on the stack: *pop *pop *push 8 *pop *push 3 what does the stack contain from top to bottom after the operations are performed?

3 9 7 4

how many bytes does the int32 type allocate?

4

what must you use as the condition of an If statement?

a boolean expression

when a single inheritance model is used:

a class can inherit from only one base class

when a program calls a function, in which type of data structure is memory allocated for the variables in that function?

a heap

In the agile software methodology, what is a sprint?

a month long or shorter development life cycle

you have an employee class. you need to expose a class member to hold the value of each employee's department. what should you create?

a public property

A data structure that stores data on a first-in first-out (FIFO) basis is called:

a queue

you are creating an application that routes technical support requests to employees. the application must route the requests in the order in which they were received. which data structure should you use to store the requests?

a queue

you are creating an application that will process ticket sales for a theater. Ticket requests must be taken in the same order in which they were received. which data structure should you use?

a queue

a data structure that stores data on a last-in first-out (LIFO) basis is called:

a stack

you need to write a block of code that will log user activity in a text file, but it does not need to return a value to the code that is executing. what type of code block should you write?

a subroutine

planning, developing, testing, and deploying are all aspects of:

application lifecycle management

what term is used to describe a class that serves as a starting point for the new class?

base class

you need to record whether users have signed up to receive e-mail from your web application. your solution should use the least amount of memory possible. which should you choose?

boolean

which statement about class and structure are true?

classes are on the heap and structures are on the stack

what must you invoke to instantiate a class?

constructor

what term best describes a procedure that is automatically invoked when an object is first instantiated?

constructor

you need to model an "is a" relationship. what do you do?

creates a class that inherits from another class

a requirements document contains the following info *a customer has one or more accounts *an account can belong to only one customer Which class or classes should you create to model the requirements and minimize the number of classes?

customer and account

you need to represent a number that has decimal places re-quiring 15 digits of precision. which numeric data types could you use? (two)

decimal and double

a class construct has no parameters. what type of constructor is this?

default

in the code shown in the exhibit, the keywords public, protected, and private:

determine the accessibility of this class and its members to code within other classes

you need to execute a set of statements once, test for a condition, and then repeat execution only if the condition is true. which loop structure should you use?

do

you create an if statement that specifies a condition. you need to include code that should execute if the condition on not true. what should you use?

else

a class contains a public method named ComputeSalesTax that computes the sales tax based on a specified state abbreviation and a dollar amount. this eliminates the need for client code to know the sales tax rates for each state. which object-oriented feature is this called?

encapsulation

the car class and the truck class both inherit characteristics from the vehicle class. which object-oriented programming term describes this concept?

encapsulation

the catch block of an error handler:

executes when an exception is thrown

v code happens dim a as integer = 6 dim b as integer = 4 dim y as integer = 7 dim z as integer = 2 dim _result as boolean = true _result = a < (b-z) AND (y>z) what is the value of _result at the end?

false

you want to execute a set of statements 10 times. which loop should you use?

for

you need to iterate through a collection of strings and print each item in the collection. you do not know how many items are in the collection. you do not want to cast the collection to IEnumerable. which loop?

for...each

A class named Pet is derived from a class named animal. the dog class is derived from the pet class and includes attributed belonging to the pet class and the animal class. what object oriented programming term best describes this concept?

inheritance

A class named employee contains a protected member named salary. a class named manager does not define the salary member, nut the manager class can access the salary member in the employee class. what does this represent?

inheritance

in a try...catch...finally block, where should you put code that must execute when a specific exception occurs?

inside a catch block

in a try...catch...finally block, where should you put code that must always execute regardless of whether an exception occurs

inside the finally block

the process of creating an object is called

instantiation

a web application requires changes after it has been deployed. what term is used to describe this process?

maintenance

your application contains the cat class shown in the exhibit. *code gets executed* what text is displayed when the code has executed?

one is white the other is black

a class named shape contains a method named calculate- area that is declared as protected. which classes can the calculate area method?

only the shape and all classes that inherit from shape

the car class and the truck class both inherit the blowhard method from vehicle class.... which object-rented programming term describes this concept?

polymorphism

the tricycle class and the bicycle class are both derived from the ToysWithWheels class. what object-oriented programming term describes this concept?

polymorphism

two classes are derived from the same base class and both override the same inherited method to provide their own implementation. which term best describes this concept?

polymorphism

you want the members of a class to be accessible only to code that is within the same class. which access modifier should you use?

private

in software development, a idle that is created during the panning and specification phase is called a:

prototype

you are creating a web app. for someone who sews custom-made clothing. the application will use a simple shopping cart. interested buyers can put together specifications for garments and place garments in the shopping cart to receive an estimated cost. which class should you create to model the requirements and the minimize the number of classes?

shoppingCart class and Garment class

the finally block of an exception handler is:

something long with try statement

your company uses the waterfall software development life cycle In which phase are software bugs discovered and fixed?

testing

what is unit testing?

testing to ensure that each small unit of code behaves as expected.

a class hierarchy as follows: sqlLogger inherits from dbLogger, and dbLogger inherits from Logger. Logger defines a method name WriteToLog. dbLogger and sqlLogger override this method. .... .... what happens when you call this method?

the WriteToLog of the sqlLogger class executes

a class member defined with the private access modifier can only be accessed from:

the class in whited it is defined

three concrete classes named circle, square, and triangle all inherit from a base class named shape. the three concrete classes provide different implementations of a method named calculate area, which is defined in shape class. which concept is representative of polymorphism?

the different implementations of the calculate area method.

you implement a method to create an instance of a class named shape and store it in a local variable. how do the stack and the heap participate in the creation of the shape instance?

the shape is created on a heap and stores a pointer to the shape instance

_result = a mod b > c ^ code executed what is the value of the variable result when the code has executed?

true

you anticipator that an exception might occur in a block of code. which type of statement should you use to handle the exception?

try...catch...finally

you need to execute a set of statements and retain control of execution if one of three exceptions occurs. which decision structure should you use?

try...catch...finally

a requirements document contains the following info *a vendor has zero of more products *a product can be sold by one or more vendors Which class or classes should you create to model the requirements and minimize the number of classes?

vendor and product


Kaugnay na mga set ng pag-aaral

MUS 150 - Elements of Music Smartbook

View Set

Natural Disasters (Fill In The Blank)

View Set

Ch 23 Mgmnt of Respiratory Tract Disorders PrepU

View Set