Search Header Logo

swe111 quiz 1

Authored by Riham KamalAbdelAziz

Computers

University

Used 5+ times

swe111 quiz 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is function overloading?

Define same functions with the same name but different return types.

Define multiple functions with the same name but different parameter lists.

Using too many functions in a program.

Calling the same function multiple times in main().

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about function overloading is FALSE?

Functions can be overloaded based on the number of parameters.

Functions can be overloaded based on the return type alone

Functions can be overloaded based on different parameter types.

Functions with same names can be overloaded.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

what is the output ?

Inside function: 15 After function call: 15

Inside function: 15 After function call: 10

Compilation error

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens when we pass an argument by value?

The function gets a copy of the variable.

The original variable is modified.

The function directly accesses the memory of the original variable.

The compiler generates an error.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of this overloaded function call?

7
6.0

7
6

Compilation error

Undefined behavior

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the advantage of function overloading?

Reduces the need for multiple function names.

Increases code complexity.

Makes it harder to understand the code.

Prevents the use of different data types in a function.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

what is the error ?

cout statement needs to be written after the return statement

Cannot return a value since the function is of type void

Need to pass both x and y parameters by reference

Cannot multiply x with y and return the answer in the same line

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?