OA Exams

  • web.groovymark@gmail.com
  • December 17, 2024

Question 21

What is Unicode, and when was it published?

a) A coding language, 1980
b) A character encoding standard, 1991
c) A programming language, 2000
d) A data processing system, 1995

Correct Answer: b) A character encoding standard, 1991

Explanation: Unicode, published in 1991, provides a universal standard for character encoding, supporting more than 100,000 characters.

Question 22

What is pseudocode?

a) A flowchart
b) Text resembling code for easier understanding
c) A compiled program
d) An encrypted algorithm

Correct Answer: b) Text resembling code for easier understanding

Explanation: Pseudocode is a simple, informal description of what a program does, written in a way that humans can easily understand.

Question 23

What is an assignment statement?

a) Declares a function
b) Assigns a variable with a value
c) Creates an array
d) Assigns a constant

Correct Answer: b) Assigns a variable with a value

Explanation: An assignment statement is used to assign a value to a variable in programming, such as x = 5.

Question 24

What is a variable declaration?

a) Declares a constant
b) Declares a new variable’s name and type
c) Declares a function
d) Declares a loop

Correct Answer: b) Declares a new variable's name and type

Explanation: A variable declaration specifies the type and name of a variable, telling the compiler to reserve memory for it.

Question 25

What is an identifier in programming?

a) A keyword in the code
b) A name created by a programmer for variables or functions
c) A reserved word
d) A loop structure

Correct Answer: b) A name created by a programmer for variables or functions

Explanation: An identifier is a unique name created by the programmer for variables, functions, or classes in a program.

Question 26

What is a reserved word (or keyword)?

a) A user-defined function name
b) A word that is part of the programming language
c) A variable name
d) A library function

Correct Answer: b) A word that is part of the programming language

Explanation: Reserved words, or keywords, are predefined in a programming language and cannot be used as variable names or identifiers.

Question 27

What is a naming convention in programming?

a) A rule for writing comments
b) A set of style guidelines for naming variables
c) A method to name functions
d) A procedure to declare variables

Correct Answer: b) A set of style guidelines for naming variables

Explanation: A naming convention is a set of rules that defines how to name variables, functions, or classes in a program.

Question 28

What is an expression in programming?

a) A statement that declares a variable
b) A combination of variables, literals, operators, and parentheses
c) A function call
d) A comment

Correct Answer: b) A combination of variables, literals, operators, and parentheses

Explanation: An expression in programming combines variables, constants, and operators to evaluate to a value.

Question 29

What is a literal in programming?

a) A data type
b) A specific value in code
c) A reserved word
d) A comment

Correct Answer: b) A specific value in code

Explanation: A literal is a fixed value written directly in the code, such as a number or string.

Question 30

What is an operator in programming?

a) A person who writes code
b) A symbol that performs a calculation
c) A function name
d) A variable type

Correct Answer: b) A symbol that performs a calculation

Explanation: An operator is a symbol used in programming to perform calculations or operations on data, such as + for additio

Question 31

What is the order of precedence for arithmetic operators?

a) + – * / %
b) * / % + –
c) ( ) * / + –
d) + – % * /

Correct Answer: b) * / % + -

Explanation: The order of precedence dictates that multiplication, division, and modulus operators have higher precedence over addition and subtraction.

Question 32

What is incremental development?

a) Writing the entire program before testing
b) Writing, compiling, and testing small amounts of code incrementally
c) Writing without testing
d) Writing programs in a single session

Correct Answer: b) Writing, compiling, and testing small amounts of code incrementally

Explanation: Incremental development is the process of writing and testing a small portion of code before moving on to the next portion.

Question 33

What is a floating-point number?

a) A real number like 98.6 or -5.5
b) A whole number like 10
c) A string value
d) A special character

Correct Answer: a) A real number like 98.6 or -5.5

Explanation: A floating-point number is a number that has a decimal point, allowing it to represent fractional values.

Question 34

What is a floating-point literal?

a) A function that handles decimals
b) A number with a fractional part, even if that fraction is 0
c) A variable that can store decimal values
d) A string

Correct Answer: b) A number with a fractional part, even if that fraction is 0

Explanation: A floating-point literal is a numeric value that includes a decimal point, such as 3.0 or 0.5.

Question 35

What is the result of 12.0 / 0.0 in programming?

a) Zero
b) Positive infinity
c) Error
d) Negative infinity

Correct Answer: b) Positive infinity

Explanation: Dividing a non-zero floating-point number by 0 results in positive infinity.

Question 36

What is the result of 0.0 / 0.0 in programming?

a) Positive infinity
b) Zero
c) NaN (Not a Number)
d) Error

Correct Answer: c) NaN (Not a Number)

Explanation: Dividing 0.0 by 0.0 results in an undefined value, known as NaN (Not a Number).

Question 37

What is a function in programming?

a) A comment added to code
b) A list of statements executed by invoking the function’s name
c) A variable declaration
d) An error handling routine

Correct Answer: b) A list of statements executed by invoking the function's name

Explanation: A function is a block of organized, reusable code that performs a specific task when called.

Question 38

Which function returns the square root of x?

a) SquareRoot(x)
b) RaiseToPower(x, 2)
c) AbsoluteValue(x)
d) RandomNumber(x)

Correct Answer: a) SquareRoot(x)

Explanation: The function SquareRoot(x) returns the square root of a given number x.

Question 39

How do you calculate the power of 4²?

a) 4 * 2
b) 4 + 4
c) 4 * 4
d) 4 – 4

Correct Answer: c) 4 * 4

Explanation: To calculate the power of 4², you multiply 4 by itself, which equals 16.

Question 40

What does the SeedRandomNumber function do?

a) Initializes an array
b) Generates a list of random numbers
c) Seeds the random number generator
d) Restarts the program

Correct Answer: c) Seeds the random number generator

Explanation: SeedRandomNumber is used to seed the random number generator, ensuring the same sequence of random numbers is generated each time.

Complete the Captcha to view next question set.

Tags

Prev Post
WGU D278 Practice Exam Questions – Set 1 – Part 3
Next Post
WGU D278 Practice Exam Questions – Set 2 – Part 1