Elance Introduction To Programming Test Answers 2015



True or False: Java is an Object Oriented language?

False
True

 

 

A do while loop is an example of a ...

precheck loop
postcheck loop
infinite
fixed loop

 

 

In a flow chart, the symbol used for decision making is a ...

arrow
rectangle
circle
diamond

 

 

What does "||" mean in Java?

NOT
IF
OR
AND

 

 

Which of the following is NOT a key concept in object oriented programming?

Inheritance
Encapsulation
Looping
Abstraction

 

 

Given a = true, b = false; what is the value returned by (a and b)?

False
1
887
777

 

 

Which of the following is NOT a commonly used comparison operator?

Assignment
Less than or equal to
Equality
Greater than

 

 

Hiding internal data from external programs or objects and allowing access to it through only publicly declared methods is known as ___________.

data protection
data inheritance
internal data
data encapsulation

 

 

Which of the following is NOT an Integrated Development Environment (IDE)?

Visual Studio
DreamWeaver
FrontPage
Notepad

 

 

A precise sequence of steps to solve a problem is called a(n)...

routine
algorithm
statement
program

 

 

In C++, what does the "%" operator do?

Multiplication
Division
Addition
Modulo

 

 

What is Programming?

Controlling a computer with a mouse
Provide (a computer or other machine) with coded instructions for the automatic performance of a particular task.
Telling the computer what to do in human language
Using a computer for spreadsheets or word processing

 

 

Which of the following is the starting index of an array in C++?

any number
0
1
-1



Each pass through a loop is called a(n)...

enumeration
iteration
pass through
culmination

 

 

If an external object or program needs direct access to a variable in your class, you should declare it as a _______ variable.

private
public
inherited
protected

 

 

What is a variable?

A value that never changes
A reference to information that can change
A value that is set once and locked

 

 

Which of the following is a value of a boolean data type?

-1
text'
6
False

 

 

In Java, the return type of a function that does not return any value must be ____.

void
float
double
int

 

 

How many bits are in a byte?

8
2
100
1024

 

 

What are "Nested" loops?

A loop that assigns variables
A large "for" loop
A loop within a loop
A large "while" loop

 

 

When are "For loops" used?

To repeat code a known number of times
When a value is equal
It is only used on non object-oriented languages

 

 

Which of the following is NOT a common data type used in most languages?

alphanumeric
boolean
string
integer

 

 

What is a "Matrix"?

A multi dimensional array
A loop that includes variables
An array with a list of values

 

 

A _______ is a computer program that transforms source code into another computer language; usually in order to create an executable program.

Debugger
Third-Generation Programming Language
Compiler
Fourth-Generation Programming Language

 

 

True or False: Java is a cross-platform language?

False
True

 

 

C++ is:

method oriented
none of these
object oriented
procedure oriented

 

 

What digits are in Binary?

0, 1, 2, 3
0 and 1
0 through 10
0 through 5

 

 

In strongly typed languages, a variable must be ________ before it can be used.

declared
removed
reset
erased

 

 

What is an Array?

A non changeable variable
A list of values
A large variable

 

 

What does "!=" mean in Java?

False
Equal
True
Not Equal

 

 

True or False? Floats include decimals

False
True

 

 

How many bits are in a byte?

16
4
24
8

 

 

_______ is a programming paradigm that uses objects to contain data fields and associated programs called methods.

web programming
procedural programming
imperative programming
object oriented programming

 

 

What is an example of a "Scripting" Language?

JavaScript
C#
C++
Objective-C

 

 

What does " = " do?

It checks for equality
It removes code from being executed
It assigns a value to a variable

 

 

When are "While" loops used?

To halt a program
If you don't have space for a for loop
When we don't know how many times a loop has to run, but want it to run when a criteria is active
To save memory

 

 

Given the following code logic, when will statement 1 be executed? If (condition) then statement 1 else statement 2 end if

When the condition is false.
When the condition is true.
Statement 1 will never be executed.
When the condition is true or false.

 

 

______ is an identifier whose value cannot be altered by the program during execution.

Variable
Constant
Attribute
Parameter

 

 

Which of the following is a programming language?

Java
Pascal
C++
All of these
C#

 

 

What does a compiler do?

Nothing, it isn't used anymore
It packages your code in a .zip file
Takes your programming language and converts it to machine readable code
Takes a program and turns it into human readable code

 

 

What does " == " check?

Equality between two variables
It prints out a variable
The sum of two numbers
The result of a code block

 

 

A garbage collector does what?

Takes out your office garbage.
Allocates memory for new objects.
Cleans up garbage on the screen.
Collects and disposes of junk email.
Reclaims memory occupied by data that is no longer in use.

 

 

The correct syntax of do-while loop is...

do { statements; } while ( condition );
while ( condition ); do { statements; };
{ statements; } do-while();
( condition) while; do { statements; };

 

 

What is debugging a program?

Finding and fixing errors in your program.
Testing the program
Introducing errors in the program to see how it holds up
Usability Testing

 

 

Given the following code logic, when will statement 2 be executed? If (condition) then statement 1 else statement 2 end if

When the condition is true.
Statement 2 will be executed when statement 1 is executed.
When the condition is false.
When the condition is true or false.

 

 

Integer, boolean, and string are examples of a _________.

variable
object
class
data type

 

 

______ is a collection of data items of the same size and type that can be selected by indices computed at run-time.

Object
Function
Method
Array

 

 

What is a GUI?

A popular programming language
Text based instructions
A graphical user interface
A Generic User Instruction

 

 

A ________ variable refers directly to another value stored elsewhere in the computer memory using its address.

object
class
function
pointer

 

 

Which is more efficient?

i += j;
i = i + j;

 

 

How many decimal places are in an Integer?

2
0
1
3

 

 

Which of the following is NOT an object oriented programming language?

C++
Ruby
COBOL
JAVA

 

 

What does ASCII stand for?

Analytical Student Comprehension Intelligence Index
Automation Standards for Computing Information Institution
American Standard Code for Information Interchange
Analytical Standard Code for Information Interchange

 

 

How do you print "Hello World" in C?

printf("Hello World")
println(Hello World)
println("Hello World")
printf(Hello World)

 

 

&& is a(n) ______ operator:

relational
unary
arithmetic
logical

 

 

________ passes a direct reference of a variable to the procedure and the procedure can change the value of the calling program's variable.

Pass by reference
Pass by value
An object
A class

 

 

An example of a LIFO (Last In First Out) data structure is ...

a queue
a hash
a stack
an array
a map

 

 

Given a = true, b = false; what is the value returned by (a or b)?

0
1
False
True

 

 

_______ is the set of rules that defines the combinations of symbols that are considered to be a correctly structured code line or fragment in that language.

Syntax
Standards
Programming language
ASCII

 

 

A ________ is a programming language that executes instructions directly, without previously compiling a program into machine-language instructions.

HTML
compiler
interpretted language
object oriented languages

 

 

C Language was developed for which OS?

UNIX
LINUX
Other
Windows

 

 

What does the hash function "245 mod 10" output?

5
7
8
10

 

 

What type of loop executes at least once before checking the condition?

None of them.
Do OR Do While
For
While
All of them

 

 

What is the control variable of a loop called?

global variable
index variable
private variable
local variable

 

 

_______ passes a copy of a variable's value to a procedure and the procedure cannot change the value of the calling program's variable.

An object
A class
Pass by value
Pass by reference

 

 

For a compiled language, when do syntax errors occur?

Both compile-time and run-time
Run-time
Compile-time
It's impossible to have syntax errors in a compiled language.

 

 

In order for a binary search to work on an array, which of the following must be true?

The array must be partitioned into two lists.
The array must be sorted.
The array cannot be sorted.
You cannot binary sort an array.

 

 

What is the largest value that be stored in a byte?

255
8
1
10

 

 

What is a parent node in a tree structure?

A node that has at least one child node
A node that owns intself
A node that is the root

 

 

A while...do loop is an example of a(n)...

fixed loop
postcheck loop
precheck loop
infinite loop

 

 

Which of the following is NOT an interpreted language?

C++
PHP
Javascript
Ruby

 

 

What is this called: var = (foo == bar) ? 'foo' : 'bar';

Special operator
Unary operator
Boolean operator
Ternary operator

 

 

What is the decimal value of the hexadecimal number "FF" ?

#FFFFFF
254
1024
255
0

 

 

What is the decimal value of the binary number 101?

9
2
101
5

 

 

A ______ is a machine level programming language.

compiler
Second-Generation programming language (2GL)
First-Generation programming language (1GL)
Object Oriented programming language

 

 

The compiler of the C language is written in...

C Language
Java Language
UNIX
Fortran Language

 

 

Given the following code, what will be the value of i when the loop finishes executing? a = 5 i = 0 while (a < 2) { i = i+1 }

10
2
0
5

 

 

A linked data structure where the nodes have two pointers, one to the previous node, and one to the next node, is known as a(n)...

array
queue
linked list
doubly linked list
binary tree

 

 

What is the value of an integer variable before it has been instantiated?

0
NULL
1
a variable must be instantiated upon creation
Depends on the language specification

 

 

If the elements of an array are already sorted then the useful search algorithm is...

Random search
Linear search
Binary search
Quick search

 

 

Which of the following must be true in a Binary Tree?

If either children node of the Tree is null, then the other node must also be null.
None of these.
A Binary Tree's nodes have not more than two child nodes, typically named 'left' and 'right'.
The value of left node must be less than the value of the right node.

 

 

Which of the following does NOT evaluate to true?

NOT false
(NOT false and true)
true or false
NOT (true or false)

 

 

An example of a single pass language is

Java
Ruby, Perl
C++, C#, C
Objective C

 

 

Which of the following is NOT a main computer system component?

main memory
secondary storage device
operating system
CPU

 

 

Which is the correct order of complexity, from fastest growing to slowest growing:

O(2^n), O(n^2), O(log(n)), O(n), O(n*log(n)), O(1)
O(2^n), O(n^2), O(n*log(n)), O(n), O(log(n)), O(1)
O(n^2), O(2^n), O(n*log(n)), O(n), O(log(n)), O(1)
O(n^2), O(2^n), O(log(n)), O(n), O(n*log(n)), O(1)

 

 

True or False: You need a sorted array when doing a linear search.

True
False


No comments:

Post a Comment