Search Header Logo

Chapter 6 - Part 3 Quiz

Authored by Kevin Tinsley

Instructional Technology

University

Used 2+ times

Chapter 6 - Part 3 Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

A program includes the following function.

line 1 void printHeading()

line 2 {

line 3 cout << "The History of Computers \n";

line 4 }

The program's main function includes the following code segment.

line 12 for (int count = 0; count <3; count ++)

line 13 { printHeading ();

line 14 cout << "I called printHeading \n|;

line 15 }

#1 Does line 1 contain a function header or a function call?

2.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

A program includes the following function.

line 1 void printHeading()

line 2 {

line 3 cout << "The History of Computers \n";

line 4 }

The program's main function includes the following code segment.

line 12 for (int count = 0; count <3; count ++)

line 13 { printHeading ();

line 14 cout << "I called printHeading \n|;

line 15 }

#2 Does line 13 contain a function header or a function call?

3.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

A program includes the following function.

line 1 void printHeading()

line 2 {

line 3 cout << "The History of Computers \n";

line 4 }

The program's main function includes the following code segment.

line 12 for (int count = 0; count <3; count ++)

line 13 { printHeading ();

line 14 cout << "I called printHeading \n|;

line 15 }

#3 How many times is the printHeading function called? (a number)

4.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

A program includes the following function.

line 1 void printHeading()

line 2 {

line 3 cout << "The History of Computers \n";

line 4 }

The program's main function includes the following code segment.

line 12 for (int count = 0; count <3; count ++)

line 13 { printHeading ();

line 14 cout << "I called printHeading \n|;

line 15 }

#4 Which line number has code that causes the program to leave the printHeading function and return to main? (a number)

5.

FILL IN THE BLANK QUESTION

2 mins • 1 pt

A program includes the following function.

line 1 void printHeading()

line 2 {

line 3 cout << "The History of Computers \n";

line 4 }

The program's main function includes the following code segment.

line 12 for (int count = 0; count <3; count ++)

line 13 { printHeading ();

line 14 cout << "I called printHeading \n|;

line 15 }

#5 When the program returns to main, which line's code is executed next? (a number)

6.

FILL IN THE BLANK QUESTION

1 min • 1 pt

How many return values may a function have? (a number)

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Write a header for a function named distance. The function should return a double and have two double parameters: rate and time

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?