A. When x is less than one hundred



Nbsp; 1. What is the output? A.120; B.240; C.310; D.70; E.550;   2. Structure definition a) b) c) d)   3. Keyword of structure

A)Struct

b)Structure

c)Str

d)Strctur

 

4. Which keyword doesn’t exist?

a)Struct

b)Class

C)That

d)This

 

5. Which of this keyword isn’t access specifier?

 a)Private

 b)Public

 c)Protected

D)Defended

6. What type of access have class members by default?

A)Private

b)Public

c)Protected

d)Defended

7. Which of this statement used to define a member of a class from outside the class definition itself?

a)::

b)>>

c)<<

d)/*

 

8. What will be output of this code?

 

A)   area: 12

b)   area=12

c)    Area:12

d)   area:34

 

9. What will be output of this code?

A)   area: 1

b)   area: -1

c)    Area: -1

d)   area:-1

 

10. What will be output of this code?

a)    area: 12

B)   There will be an error.

c)    Area:12

d)   area:12

 

11. What will be output of this code?

a)    area: 155

B)   area: 25

c)    area: 75

d)   area: 225

12. What will be output of this code?

a)    area: 12

B)   area: 0

c)    Area:12

d)   area: 16

 

13. What is the difference between array and structure?

a) only in their declaration

b) they haven't any differences

c) structure can include members of different types of data

d) structures are more powerful

e) array incudes only integers

 

14. Which code outputs the member "name" of object student? (student is object of any structure)

a. cout<<struct.name

b. cout<<student[name]

c. cout<<student.name

d. cout<<struct.student.name

 

15. What is the difference between classes and structures?

a.we can have functions in classes

b. they are similar

C. structures have only public access specifier

d. classes include characters;

e. structures include protected access specifier

 

16. In classes, if we declare object without keywords like public, which type will it be of?

A. private

b. public

c. protected

d. it won't have access specifier

e. friend

 

17. How could you call in main the function input in object school of some class?

a. input()

b. input

C. school::input()

 d. school::input

 

18.  class student {string name, surname} Aibar;      What is underlined?

A. object of class student

 b. member of class student

 c. member of object student

 d. parameter of class student

 

19. Which access specifier means that the member can be used only by the functions of this class?

A. private

b. public

c. protected

d. this specifier doesn't exist

 

20. Which is the right declaration of the object of structure student:

a. struct Aibar

b. struct student:Aibar

C. student Aibar

d. student.Aibar

e. struct student=Aibar

 

21. There is one mistake in code, in which line?

a.1

b.2

c.3

d.4

E.5

22. Which of the following correctly declares an array?

A. int anarray[10];

B. int anarray;

C. anarray{10};

D. array anarray[10];

 

23. What is the index number of the last element of an array with 29 elements?

A. 29

B. 28

C. 0

D. Programmer-defined

 

24. Which of the following is a two-dimensional array?

A. array anarray[20][20];

B. int anarray[20][20];

C. int array[20, 20];

D. char array[20];

 

25. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?

A. foo[6];

B. foo[7];

C. foo(7);

D. foo;

 

26. Which of the following gives the memory address of the first element in array foo, an array with 100 elements?

A. foo[0];

B. foo;

C. &foo;

D. foo[1];

 

27.  When does the code block following while(x<100) execute?

A. When x is less than one hundred

B. When x is greater than one hundred

C. When x is equal to one hundred

D. While it wishes

 

28. Which of the following classes handles file input?

A. ofstream

B. ifstream

C. instream

D. inputfile

 

29. Which of the following is not a valid ofstream argument?

A. ios::app

B. ios::trunc

C. ios::noreplace

D. ios::create

 

30. What does ios::ate mean as an argument to ofstream?

A. Open file, but do not create.

B. Open file, create.

C. Open file for read access only.


Дата добавления: 2018-05-12; просмотров: 278; Мы поможем в написании вашей работы!

Поделиться с друзьями:






Мы поможем в написании ваших работ!