[C ++ exploration tour] Part 1 Lesson 13th: Part 1 quiz

Source: Internet
Author: User

[C ++ exploration tour] Part 1 Lesson 13th: Part 1 quiz

Introduction

1. Part 1 Lesson 13: Part 1 quiz

2. Part 2 first lesson notice: an object-oriented approach to the inside story of string

Part 1 quiz

In the previous lesson, we learned the top priority of pointer.

Then, our first part of the course ended successfully. However, how can I let you go so easily? (In fact, I am a good socialist youth ).

Therefore, you must have a simple test question to check the learning results. It's not hard. Don't worry.

Test Question

1. Who is the father of C ++?

Birj Tromman

Bjarne Stroustrup

Barj Grossoup

2. What is the software that combines a text editor, compiler, and debugger?

IDLE

IDE

DEI

IED

 

3. What is the role of the following code?

Cout <"Hello world! "<Endl;

 

Display this text in standard output

Ask the user to enter this text on the keyboard

Open a new window with the title of this text

 

4. I want to store a user's name in a variable. What is the most suitable variable type?

Int

Bool

String

Char

 

5. If the value of variable is 5, what is the value of variable after executing the following command?

Variable ++;

 

4

5

6

7

 

6. the following code is available:

Int a (20), B (10), result (0 );

Result = a + B;

Finally, what is the value of the result variable?

 

0

10

20

30

 

7. If I define a variable like this:

Int const height (15 );

So, if I write such an instruction in a program

Height ++;

After the program is run, what is the value of height?

 

16

15

The program cannot be compiled.

 

8. Can the following arrays store bool variables?

Int bestScores [10];

 

Yes

No

 

9. If I have a valid variable named price, How can I obtain its memory address?

 

& Price

Price

@ Price

Price. address

 

10. What is the main function of the following code?

# Include

# Include

Using namespace std;

 

Int main ()

{

Ofstream myStream ("C:/test.txt ");

Return 0;

}

 

Open the file in write mode, and then close the file automatically

Write 0 to the file

Copy a file

Answer

 

B

B

A

C

C

D

C

B

A

A

Part 2 Lesson 1 advance notice

Today's class is here. Come on!

In the next lesson, we will learn:Object-oriented research, the shocking inside story of string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.