Courses » SS2 » SS2 ICT » ICT Exam Topics » Basic Programing II - Questions and Answers

Basic Programing II - SS2 ICT Past Questions and Answers - page 1

1

What is the purpose of the Python code provided?

A

To calculate the square root of a number

B

To calculate the result of an algebraic equation for a given value of 'x'

C

To find the factorial of a number 

D

To determine the greatest common divisor of two numbers

correct option: b
Users' Answers & Comments
2

What is the name of the function that defines the algebraic equation in the code?

A

equation_function

B

algebraic_formula

C

calculate_result

D

compute_equation

correct option: d
Users' Answers & Comments
3

What type of data does the user input for the value of 'x'?

A

Integer

B

String

C

Float

D

Boolean

correct option: c
Users' Answers & Comments
4

What mathematical operation does the code perform to calculate the result?

A

Addition

B

Subtraction

C

Multiplication d

D

Polynomial evaluation

correct option: d
Users' Answers & Comments
5

In the equation 2x**2 + 3x - 5, what does 'x' represent?

A

A constant value

B

A variable

C

The result of the equation

D

The input value from the user

correct option: b
Users' Answers & Comments
6

How does the code handle invalid input from the user?

A

It displays an error message and terminates

B

It automatically converts the input to a valid number.

C

It ignores the input and continues with the calculation. 

D

The code does not handle invalid input.

correct option: d
Users' Answers & Comments
7

What is the final output of the code?

A

The input value of 'x' only

B

The result of the equation only

C

Both the input value of 'x' and the result of the equation

D

None of the above

correct option: c
Users' Answers & Comments
8

What data type does the 'result' variable hold

A

String 

B

Integer

C

Float

D

Boolean

correct option: c
Users' Answers & Comments
9

What does the code use to format and display the result?

A

The format() method

B

The printf() function

C

The f-string formatting 

D

The str() function

correct option: c
Users' Answers & Comments
10

What does the compute_equation() function return?

A

The input value of 'x'

B

The equation itself

C

The result of the equation

D

A random number

correct option: d
Users' Answers & Comments
Recommended: SS2 ICT Lessons
Please share this, thanks: