Introduction to Programming MCQs

Introduction to Programming MCQs

Our team has conducted extensive research to compile a set of Introduction to Programming MCQs. We encourage you to test your Introduction to Programming knowledge by answering these multiple-choice questions provided below.
Simply scroll down to begin!

1: True or False: Java is an Object Oriented language?

A.   False

B.   True

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

A.   Ternary operator

B.   Special operator

C.   Unary operator

D.   Boolean operator

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

A.   diamond

B.   rectangle

C.   circle

D.   arrow

4: What is debugging a program?

A.   Introducing errors in the program to see how it holds up

B.   Testing the program

C.   Finding and fixing errors in your program.

D.   Usability Testing

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

A.   Looping

B.   Encapsulation

C.   Abstraction

D.   Inheritance

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

A.   Attribute

B.   Variable

C.   Parameter

D.   Constant

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

A.   iteration

B.   culmination

C.   enumeration

D.   pass through

8: What is a "Matrix"?

A.   The real word

B.   A loop that includes variables

C.   A multi dimensional array

D.   An array with a list of values

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

A.   string

B.   boolean

C.   integer

D.   alphanumeric

10: What is an Array?

A.   A list of values

B.   A non changeable variable

C.   A large variable

11: What is an example of a "Scripting" Language?

A.   JavaScript

B.   C++

C.   Objective-C

D.   C#

12: When are "While" loops used?

A.   When we don't know how many times a loop has to run, but want it to run when a criteria is active

B.   To halt a program

C.   If you don't have space for a for loop

D.   To save memory

13: What does a compiler do?

A.   Nothing, it isn't used anymore

B.   Takes your programming language and converts it to machine readable code

C.   Takes a program and turns it into human readable code

D.   It packages your code in a .zip file

14: What does "!=" mean in Java?

A.   Not Equal

B.   True

C.   Equal

D.   False

15: Which of the following is a programming language?

A.   C++

B.   Pascal

C.   C#

D.   All of these

E.   Java

16: What does " == " check?

A.   Equality between two variables

B.   It prints out a variable

C.   The result of a code block

D.   The sum of two numbers

17: What is a GUI?

A.   Text based instructions

B.   A popular programming language

C.   A graphical user interface

D.   A Generic User Instruction

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

A.   int

B.   float

C.   double

D.   void

19: What digits are in Binary?

A.   0 and 1

B.   0, 1, 2, 3

C.   0 through 10

D.   0 through 5

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

A.   removed

B.   reset

C.   declared

D.   erased

21: When are "For loops" used?

A.   It is only used on non object-oriented languages

B.   When a value is equal

C.   To repeat code a known number of times

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

A.   6

B.   -1

C.   text'

D.   False

23: How many bits are in a byte?

A.   2

B.   1024

C.   8

D.   100

24: What are "Nested" loops?

A.   A loop that assigns variables

B.   A loop within a loop

C.   A large "while" loop

D.   A large "for" loop

25: What is Programming?

A.   Using a computer for spreadsheets or word processing

B.   Controlling a computer with a mouse

C.   Provide (a computer or other machine) with coded instructions for the automatic performance of a particular task.

D.   Telling the computer what to do in human language

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

A.   public

B.   protected

C.   inherited

D.   private

27: C++ is:

A.   procedure oriented

B.   object oriented

C.   none of these

D.   method oriented

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

A.   Fourth-Generation Programming Language

B.   Compiler

C.   Debugger

D.   Third-Generation Programming Language

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

A.   1

B.   -1

C.   any number

D.   0

30: What does " = " do?

A.   It assigns a value to a variable

B.   It checks for equality

C.   It removes code from being executed

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

A.   False

B.   True

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

A.   web programming

B.   imperative programming

C.   object oriented programming

D.   procedural programming

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

A.   Addition

B.   Modulo

C.   Multiplication

D.   Division

34: What does "||" mean in Java?

A.   OR

B.   IF

C.   AND

D.   NOT

35: True or False? Floats include decimals

A.   False

B.   True

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

A.   When the condition is true.

B.   When the condition is true or false.

C.   Statement 1 will never be executed.

D.   When the condition is false.

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

A.   False

B.   1

C.   777

D.   887

38: A garbage collector does what?

A.   Cleans up garbage on the screen.

B.   Collects and disposes of junk email.

C.   Takes out your office garbage.

D.   Reclaims memory occupied by data that is no longer in use.

E.   Allocates memory for new objects.

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

A.   do { statements; } while ( condition );

B.   ( condition) while; do { statements; };

C.   while ( condition ); do { statements; };

D.   { statements; } do-while();

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

A.   Statement 2 will be executed when statement 1 is executed.

B.   When the condition is true or false.

C.   When the condition is true.

D.   When the condition is false.

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

A.   data type

B.   variable

C.   object

D.   class

42: Which is more efficient?

A.   i = i + j;

B.   i += j;

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

A.   pointer

B.   function

C.   class

D.   object

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

A.   algorithm

B.   program

C.   statement

D.   routine

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

A.   Equality

B.   Less than or equal to

C.   Assignment

D.   Greater than

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

A.   FrontPage

B.   Visual Studio

C.   Notepad

D.   DreamWeaver

47: && is a(n) ______ operator:

A.   unary

B.   logical

C.   arithmetic

D.   relational

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

A.   Method

B.   Array

C.   Function

D.   Object

49: How many decimal places are in an Integer?

A.   0

B.   3

C.   1

D.   2

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

A.   data protection

B.   data inheritance

C.   data encapsulation

D.   internal data

51: What does ASCII stand for?

A.   Analytical Student Comprehension Intelligence Index

B.   Automation Standards for Computing Information Institution

C.   American Standard Code for Information Interchange

D.   Analytical Standard Code for Information Interchange

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

A.   Ruby

B.   C++

C.   JAVA

D.   COBOL

53: How do you print "Hello World" in C?

A.   printf("Hello World")

B.   println("Hello World")

C.   println(Hello World)

D.   printf(Hello World)

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

A.   a queue

B.   a map

C.   an array

D.   a stack

E.   a hash

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

A.   0

B.   False

C.   True

D.   1

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

A.   An object

B.   Pass by reference

C.   Pass by value

D.   A class

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

A.   The array cannot be sorted.

B.   The array must be partitioned into two lists.

C.   The array must be sorted.

D.   You cannot binary sort an array.

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

A.   None of them.

B.   For

C.   While

D.   All of them

E.   Do OR Do While

59: What is a parent node in a tree structure?

A.   A node that has at least one child node

B.   A node that is the root

C.   A node that owns intself

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

A.   10

B.   7

C.   8

D.   5

61: _______ 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.

A.   Syntax

B.   ASCII

C.   Standards

D.   Programming language

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

A.   compiler

B.   object oriented languages

C.   HTML

D.   interpretted language

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

A.   Pass by value

B.   A class

C.   An object

D.   Pass by reference

64: C Language was developed for which OS?

A.   LINUX

B.   Windows

C.   UNIX

D.   Other

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

A.   infinite loop

B.   precheck loop

C.   fixed loop

D.   postcheck loop

66: What is the control variable of a loop called?

A.   local variable

B.   index variable

C.   global variable

D.   private variable

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

A.   10

B.   8

C.   255

D.   1

68: For a compiled language, when do syntax errors occur?

A.   Both compile-time and run-time

B.   Compile-time

C.   It's impossible to have syntax errors in a compiled language.

D.   Run-time

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

A.   fixed loop

B.   infinite

C.   precheck loop

D.   postcheck loop

70: What is the decimal value of the binary number 101?

A.   101

B.   2

C.   5

D.   9

71: Which of the following is NOT an interpreted language?

A.   Javascript

B.   PHP

C.   Ruby

D.   C++

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

A.   1024

B.   255

C.   254

D.   0

E.   #FFFFFF

73: A ______ is a machine level programming language.

A.   compiler

B.   Object Oriented programming language

C.   First-Generation programming language (1GL)

D.   Second-Generation programming language (2GL)

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

A.   If either children node of the Tree is null, then the other node must also be null.

B.   None of these.

C.   A Binary Tree's nodes have not more than two child nodes, typically named 'left' and 'right'.

D.   The value of left node must be less than the value of the right node.

75: 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 }

A.   0

B.   5

C.   10

D.   2

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

A.   Java Language

B.   UNIX

C.   C Language

D.   Fortran Language

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

A.   Linear search

B.   Binary search

C.   Quick search

D.   Random search

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

A.   1

B.   0

C.   NULL

D.   Depends on the language specification

E.   a variable must be instantiated upon creation

79: Which of the following does NOT evaluate to true?

A.   NOT false

B.   true or false

C.   (NOT false and true)

D.   NOT (true or false)

A.   False

B.   True

81: 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)...

A.   queue

B.   binary tree

C.   doubly linked list

D.   linked list

E.   array

82: An example of a single pass language is

A.   C++, C#, C

B.   Objective C

C.   Ruby, Perl

D.   Java

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

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

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

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

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

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

A.   CPU

B.   operating system

C.   secondary storage device

D.   main memory

85: 4 bits make ________?

A.   a nibble

B.   a byte

C.   2 bytes

D.   half byte

86: Which of the following sorting algorithms has the lowest worst-case complexity?

A.   Merge Sort

B.   Bubble Sort

C.   Selection Sort

D.   Quick Sort

87: Which sorting algorithm will take least time when all elements of input array are identical?

A.   Selection Sort

B.   Heap Sort

C.   Insertion Sort

D.   Merge Sort

88: which of the following is a programming language?

A.   JavaScript

B.   CodeScript

89: A ____ control structure tells a computer what to do based on whether a condition is true or false.

A.   Sequence

B.   Selection

C.   Pseudocode

D.   Compiled

90: A ____ defines the name and data type of program variables.

A.   Static, dynamic

B.   System requirements model

C.   Data declaration

D.   Symbol table

91: A ____ field is used when you want to restrict the data entered into the field to a list of values.

A.   Totals button

B.   Field Properties

C.   Lookup

D.   Number

92: A ____ is a request to execute a specific method and return a response.

A.   Message

B.   Alert

C.   Prompt

93: A ____ operation searches data in a table and retrieves records based on certain criteria.

A.   Join

B.   Project

C.   Find

D.   Select

94: A ____ read is an added statement that gets the first input value in a program.

A.   Stacked

B.   Nested

C.   Priming

D.   Posttest

95: A ______ is a program that runs in the background.

A.   Sleep or hibernate

B.   Process

C.   Driver

D.   Spooling

96: A ______ is a symbol used to store a location in memory.

A.   Variable

B.   String

C.   Character

97: A ________ designs and writes computer codes.

A.   Technical writer

B.   Systems analyst

C.   Programmer

D.   Business analyst

E.   Programmer

98: A ________ is a program module whose purpose is to test other modules by calling them.

A.   Stub

B.   Driver

C.   Main function

D.   Dummy program

99: A ________ method does not return a value.

A.   Void method

B.   Void

C.   None of these

100: A ________ search uses a loop to sequentially step through an array.

A.   Binary

B.   Unary

C.   Linear

D.   Relative

E.   None of these