F129 Introduction To Programming Test 1

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Xenonii
X
Xenonii
Community Contributor
Quizzes Created: 4 | Total Attempts: 992
| Attempts: 270 | Questions: 7
Please wait...
Question 1 / 7
0 %
0/100
Score 0/100
1. The result of this expression 3 + 5 * 2 + 4 is

Explanation

A computer language uses operator precedence (hierarchy) similar to what we use in maths (BODMAS).

Submit
Please wait...
About This Quiz
Programming Quizzes & Trivia

This test will ask you questions up to Chapter 6 of the study guide

Personalize your quiz and earn a certificate with your name on it!
2. How would you end a module which gives back the addition of 3 numbers. The module so far looks like this
CalculateSum(Integer a, Integer b, Integer c)
   Integer sum = a + b + c

Explanation

The correct answer is "Return sum" because the module is designed to calculate the sum of three numbers and the result is stored in the variable "sum". To end the module and provide the calculated sum as the output, the "Return" statement is used. This will return the value of the "sum" variable and terminate the execution of the module.

Submit
3. What is the data type of "hello "+name, where name is some variable storing the user's name

Explanation

The data type of "hello "+name would be a string because when we concatenate the string "hello " with the variable name, the result will be a string. In programming, when we combine two strings together, the result is always a new string. Therefore, the correct answer is String.

Submit
4. How would you call the module from the Control module to give you back the result of the sum, using the module mentioned in the previous question. So far the Control module looks like this:
Control
   Print "Give me three numbers"
   Integer x
   Enter x
   Integer y
   Enter y
   Integer z
   Enter z

Explanation

The correct answer is "Process CalculateSum(x,y,z)" because this line of code is calling the CalculateSum module and passing the variables x, y, and z as arguments. This means that the Control module is instructing the CalculateSum module to perform the calculation and return the result. The asterisks (*) in the other options are not valid syntax and do not correctly call the CalculateSum module.

Submit
5. The AND and OR logical operators take two operands one on each side. What are the data types of these operands?

Explanation

The operands are some boolean expression.E.g. if you want to check some mark if its greater or equal to 0 and smaller or equal to 100 you would do something like this: if mark >= 0 AND mark = 0 gives true or false, and mark =0 AND mark

Submit
6. Call-by-value is

Explanation

You can pass a variable to a method using call-by-value or call-by-reference. Call-by-value is simply copied into the parameter, but call-by-reference is when the actual variable is being referenced by the method you are calling. Refer to the revision sheet 2 for more information.

Submit
7. The data type of the following expression squareroot(14) is

Explanation

Reals are those numbers with a decimal point

Submit
View My Results

Quiz Review Timeline (Updated): Mar 19, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 19, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 30, 2008
    Quiz Created by
    Xenonii
Cancel
  • All
    All (7)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
The result of this expression 3 + 5 * 2 + 4 is
How would you end a module which gives back the addition of 3 numbers....
What is the data type of "hello "+name, where name is some variable...
How would you call the module from the Control module to give you back...
The AND and OR logical operators take two operands one on each side....
Call-by-value is
The data type of the following expression squareroot(14) is
Alert!

Advertisement