Студопедия

Главная страница Случайная страница

Разделы сайта

АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторикаСоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника






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.



D. Open file, set the position to the end.

31. How would you output to an open file named a_file?

A. a_file.out(" Output");

B. a_file=" Output";

C. a_file< < " Output";

D. a_file.printf(" Output");

32. What header file contains C++ file I/O instructions?

A. iostream.h

B. fstream.h

C. infstream.h

D. outstream.h

 

33. What value must a destructor return?

A. A pointer to the class.

B. An object of the class.

C. A status code determining whether the class was destructed correctly

D. Destructors do not return a value.

34. Which of the following is a valid class declaration?

A. class A { int x; };

B. class B { }

C. public class A { }

D. object A { int x; };

 

35. Which functions will every class contain?

A. None

B. Constructor

C. Destructor

D. Both a constructor and a destructor

36. What purpose do classes serve?

A. data encapsulation

B. providing a convenient way of modeling real-world objects

C. simplifying code reuse

D. all of the above

37. What does your class can hold?

a) data

b) functions

C) both a & b

d) none of the mentioned

 

38. How many specifiers are present in access specifiers in class?

a) 1

b) 2

C) 3

d) 4

39. Constructors are used to:

A) initalize the objects

b) construct the data members

c) both a & b

d) none of the mentioned

 

40. Unless otherwise specified, entire arrays are passed __________ and individual array elements are passed __________.

a. By value, by reference.

B. By reference, by value.

c. By value, by value.

d. By reference, by reference.

 

41. Which statement would be used to declare a 10-element integer array c?

a. array c = int[ 10 ];

b. c = int[ 10 ];

c. int array c[ 10 ];

d. int c[ 10 ];

42. An array is not:

42.a. A consecutive group of memory locations.

b. Subscripted by integers.

c. Declared using braces, [].

D. Made up of different data types.

43. The inline keyword:

a. Increases function-call overhead.

b. Can reduce a function’s execution time but increase program size.

c. Can decrease program size but increase the function’s execution time.

D. Should be used with all frequently used functions.

44. The OR (||) operator:

a. Has higher precedence than the AND (& &) operator.

B. Stops evaluation upon finding one condition to be true.

c. Associates from right to left.

d. Is a ternary operator.

 

45. switch can be used to test:






© 2023 :: MyLektsii.ru :: Мои Лекции
Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав.
Копирование текстов разрешено только с указанием индексируемой ссылки на источник.