Programmaing Languages and Technologies

Descripción

Olzhas
Айдана Шырманбай
Test por Айдана Шырманбай, actualizado hace más de 1 año
Айдана Шырманбай
Creado por Айдана Шырманбай hace alrededor de 5 años
397
5

Resumen del Recurso

Pregunta 1

Pregunta
1. Specify the types of operator
Respuesta
  • Logical, Bitwise, Arithmetic, Relational
  • Mathematical, Bitwise, Arithmetic, Relational
  • Assignment, Bitwise, Arithmetic, Relational
  • Logical, Bitwise, Assignment, Relational

Pregunta 2

Pregunta
2. Logical operators always evaluated from
Respuesta
  • Left to right
  • No difference
  • Not sure
  • Right to left

Pregunta 3

Pregunta
3. When an equation uses more than one type of operator then the order of precedence has to be established with the different types of operators:
Respuesta
  • Arithmetic, comparison, logical
  • Comparison, logical, arithmetic
  • Logical, arithmetic, comparison
  • Arithmetic, logical, comparison

Pregunta 4

Pregunta
4. Precedence for Logical Operators
Respuesta
  • NOT, AND, OR
  • OR, AND, NOT
  • OR, NOT, AND
  • AND, OR, NOT

Pregunta 5

Pregunta
5. What is an array?
Respuesta
  • An array is a series of elements of the different type placed in contiguous memory locations that can be individually referenced by adding an index to a unique.
  • An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by multiplying an index to a unique identifier
  • An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier
  • An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a same identifier.

Pregunta 6

Pregunta
6. When an array is partially initialized, the rest of its elements will automatically be set to zero
Respuesta
  • False
  • True
  • Nothing
  • All of them

Pregunta 7

Pregunta
7. The whole array can be passed to a function. However, it can't be changed by the code in that function
Respuesta
  • False
  • All of them
  • Nothing
  • True

Pregunta 8

Pregunta
8. What are the three steps in using a function?
Respuesta
  • Definition, prototype, invocation
  • Prototype, argument, signature
  • Definition, invocation, argument

Pregunta 9

Pregunta
9. write mpg() function prototype, that takes two type double arguments and returns a double
Respuesta
  • Double mpg(double a, double b)
  • Void mpg(){}
  • Float mpg(int a){ float b = 1; return b;}
  • Double mpg(int a, double b)

Pregunta 10

Pregunta
10. What is data structure?
Respuesta
  • is a group of data elements grouped together under one name
  • is a group of data elements grouped together under two names.
  • is a set of some elements grouped together under value
  • is a group of data elements together with some name.

Pregunta 11

Pregunta
11. The data elements in structure are also known as what?
Respuesta
  • Members
  • Data
  • Objects
  • None of the above

Pregunta 12

Pregunta
12. What will be used when terminating a structure?
Respuesta
  • Semicolon
  • Colon
  • Brackets
  • Dot

Pregunta 13

Pregunta
13. Which stream class is used to both read and write on files?
Respuesta
  • Fstream
  • Iostream
  • Ofstream
  • Ifstream

Pregunta 14

Pregunta
14. Which stream class is only used to read files
Respuesta
  • Ifstream
  • Ofstream
  • Iostream
  • Fstream

Pregunta 15

Pregunta
15. What is the difference between array and structure?
Respuesta
  • Structure can include members of different data types
  • No difference
  • Only on their declaration
  • Arrays can include only integers

Pregunta 16

Pregunta
16. What is the output from the following program code?
Respuesta
  • 10 10 10 10 10
  • 11 11 11 11 11
  • 10
  • 0 1 2 3 4
  • Error

Pregunta 17

Pregunta
17. The OR (||) operator:
Respuesta
  • Stops evaluation upon finding one condition to be true
  • Has higher precedence that AND (&&) operator
  • True if all conditions are true
  • Associates from right to left

Pregunta 18

Pregunta
18. Which of the following for headers is not valid for C++ code?
Respuesta
  • for (integer i =0; j<10; i++);
  • for (int i = 0; i<9; i++)
  • for (int i = 0; i<8; i++)
  • for (int i = 0; i<7; i++)
  • all

Pregunta 19

Pregunta
19. There might be functions with the same name, but different arguments. The function called is the one whose arguments match the invocation. What is this mean?
Respuesta
  • Function overloading
  • Function overprocessing
  • Argument type error
  • Argument dispatch error

Pregunta 20

Pregunta
20. Which of the following cannot be used to create a random numbers?
Respuesta
  • structures
  • float
  • int
  • none of the mentioned

Pregunta 21

Pregunta
21. Please evaluate !(1 && !(0 || 1)).
Respuesta
  • True
  • False
  • Unevaluatable
  • Not sure

Pregunta 22

Pregunta
22. What is the final value of x when the code int x; for(x=0; x<50; x++) {} is run?
Respuesta
  • 10
  • 50
  • 0
  • 51

Pregunta 23

Pregunta
23. How many times is a do while loop guaranteed to loop?
Respuesta
  • 0
  • Infinitely
  • 1
  • Variable

Pregunta 24

Pregunta
24. What is the output of the following code?
Respuesta
  • value
  • 77.5
  • Float
  • Variable

Pregunta 25

Pregunta
25. Which of the following is a valid function call (assuming the function exists)?
Respuesta
  • funct;
  • funct x, y;
  • funct();
  • struct funct();

Pregunta 26

Pregunta
26. Which of the following is a complete function?
Respuesta
  • int funct();
  • int funct(int x) {return x=x+1;}
  • void funct[int] {cout&tl;<"Hello"}
  • void funct{x} {cout<<"Hello"}

Pregunta 27

Pregunta
27. Which of the following is required to avoid falling through from one case to the next?
Respuesta
  • End;
  • Break;
  • Stop;
  • A semicolon;

Pregunta 28

Pregunta
28. Which of the following is the proper declaration of a pointer?
Respuesta
  • int x;
  • int &x;
  • ptr x;
  • int *x;

Pregunta 29

Pregunta
29. Which of the following gives the memory address of integer variable a?
Respuesta
  • *a;
  • a;
  • &a;
  • address(a);

Pregunta 30

Pregunta
30. Which of the following gives the memory address of a pointer a?
Respuesta
  • a;
  • *a;
  • &a;
  • address(a);

Pregunta 31

Pregunta
31. Which of the following gives the value stored at the address pointed to by the pointer a?
Respuesta
  • a;
  • val(a);
  • *a;
  • &a;

Pregunta 32

Pregunta
32. Which of the following gives the value stored at the address pointed to by the pointer ptr?
Respuesta
  • ptr;
  • val(ptr);
  • *ptr;
  • &ptr;

Pregunta 33

Pregunta
33. Which of the following accesses a variable in structure b?
Respuesta
  • b->var;
  • b.var;
  • b-var;
  • b>var;

Pregunta 34

Pregunta
34. Which of the following accesses a variable in structure mystruct?
Respuesta
  • mystruct ->var;
  • mystruct.var;
  • mystruct -var;
  • mystruct >var;

Pregunta 35

Pregunta
35. Which of the following correctly accesses the seventh element stored in diana, an array with 100 elements?
Respuesta
  • diana[6]
  • diana[7]
  • diana(7)
  • diana;

Pregunta 36

Pregunta
36. What is the correct way to write the condition y < x < z?
Respuesta
  • ((y < x) && (x < z))
  • ((y < x) || (x < z))
  • ((y < x) & (x < z))
  • ((y < x) AN (x < z))

Pregunta 37

Pregunta
37. The value 132.54 can represented using which data type?
Respuesta
  • Double
  • Void
  • Integer
  • Bool

Pregunta 38

Pregunta
38. In an assignment statement “ a=b; ” which of the following statement is true?
Respuesta
  • The variable a and the variable b are equal.
  • The value of b is assigned to variable a but the later changes on variable b will not effect the value of variable
  • The value of variable a is assigned to variable b and the value of variable b is assigned to variable a.

Pregunta 39

Pregunta
39. The difference between while structure and do structure for looping is
Respuesta
  • In while statement the condition is tested at the end of first iteration
  • In do structure the condition is tested at the beginning of first iteration
  • The do structure decides whether to start the loop code or not whereas while statement decides whether to repeat the code or not
  • In while structure condition is tested before executing statements inside loop whereas in do structure condition is tested before repeating the statements inside loop

Pregunta 40

Pregunta
40. A function that calls itself for its processing is known as
Respuesta
  • Inline Function
  • Nested Function
  • Overloaded Function
  • Recursive Function

Pregunta 41

Pregunta
41. The keyword endl
Respuesta
  • Ends the execution of program where it is written
  • Ends the output in cout statement
  • Ends the line in program. There can be no statements after endl
  • Ends current line and starts a new line in cout statement

Pregunta 42

Pregunta
42. Strings are character arrays. The last index of it contains the nullterminated character
Respuesta
  • \n
  • \t
  • \0
  • \1

Pregunta 43

Pregunta
43. Variables inside parenthesis of functions declarations have _____ level access
Respuesta
  • Local
  • Global
  • Module
  • Universal

Pregunta 44

Pregunta
44. Array indexing always starts with the number
Respuesta
  • 0
  • 1
  • -1
  • 10

Pregunta 45

Pregunta
45. Which of the following accesses a variable in structure st1?
Respuesta
  • st1->var;
  • st1.var;
  • st1-var;
  • st1>var;

Pregunta 46

Pregunta
46. Which looping process is best used when the number of iterations is known?
Respuesta
  • For
  • While
  • Do-while
  • Nothing

Pregunta 47

Pregunta
47. If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block?
Respuesta
  • parentheses ( )
  • braces { }
  • brackets [ ]
  • arrows < >

Pregunta 48

Pregunta
48. A memory address is…
Respuesta
  • where a variable is stored.
  • where a variable is defined.
  • where a variable is declares.
  • where a variable is print out.

Pregunta 49

Pregunta
49. The set of instructions that a computer will follow is known as..
Respuesta
  • program
  • variable
  • computer
  • brackets

Pregunta 50

Pregunta
50. cin >> number; is
Respuesta
  • an output statement
  • a colon
  • a variable
  • an input statement

Pregunta 51

Pregunta
51. cout << "How many items would you want?\n"; is
Respuesta
  • an output statement
  • a colon
  • a variable
  • an input statement

Pregunta 52

Pregunta
52. int number; is
Respuesta
  • an output statement
  • a variable declaration
  • a variable
  • an input statement

Pregunta 53

Pregunta
53. If x is 0, what is the value of (!x == 0)?
Respuesta
  • True
  • False
  • 2
  • 15

Pregunta 54

Pregunta
54. How to create array with n integers?
Respuesta
  • int n; cin >> n; int a = new# int[n];
  • int n; cin >> n; int& a; a = new int[n];
  • int n; cin >> n; int* a; a = new int[n];
  • int n; cin >> n; int a; a = new% int[n];

Pregunta 55

Pregunta
55. Which class should be included to work with files?
Respuesta
  • iostream
  • string
  • cmath
  • fstream

Pregunta 56

Pregunta
56. Which of the following is the output from the following C++ code?
Respuesta
  • 15 14 13 12 11 10
  • 15 14 13 12 11 10 9
  • 9
  • 15

Pregunta 57

Pregunta
57. If originally x=0, y=1, and z=3, what is the value of x, y, and z after executing the following code ?
Respuesta
  • x=0 y=3 z=3
  • x=0 y=1 z=3
  • x=3 y=3 z=3
  • x=3 y=1 z=0

Pregunta 58

Pregunta
58. What is the value of x after the following statements?
Respuesta
  • 10
  • 33
  • 3
  • 0

Pregunta 59

Pregunta
59. What is the value of x after the following statements?
Respuesta
  • 15
  • 3
  • 4
  • 0

Pregunta 60

Pregunta
60. Which of the following is the output from the following C++?
Respuesta
  • 5
  • 0
  • 4
  • 6

Pregunta 61

Pregunta
61. Given the following code fragment, what is the final value of y?
Respuesta
  • 8
  • 2
  • 4
  • 3

Pregunta 62

Pregunta
62. Which of the following is the output from the following C++ code
Respuesta
  • 10
  • 12
  • 3
  • 4

Pregunta 63

Pregunta
64. Which of the following is the final value of y from the following C++ code
Respuesta
  • 2
  • 3
  • 22
  • 0

Pregunta 64

Pregunta
63. Which of the following is the output from the following C++ code?
Respuesta
  • 6
  • 0
  • 4
  • 5

Pregunta 65

Pregunta
65. Which of the following is the final value of ‘i’ from the following C++ code ?
Respuesta
  • 5
  • 4
  • 0 1 2 3 4
  • 0 1 2 3 4 5

Pregunta 66

Pregunta
66. What is the value of x after the following code executes?
Respuesta
  • 10
  • 11
  • 13
  • 0

Pregunta 67

Pregunta
67. Given the following code, what is the final value of i?
Respuesta
  • 2
  • 4
  • 3
  • 0

Pregunta 68

Pregunta
68. What is the value of x after the following code executes?
Respuesta
  • 10
  • 11
  • 13
  • 0

Pregunta 69

Pregunta
69. What is the output of the following code segment?
Respuesta
  • 15
  • 25
  • 5
  • 0

Pregunta 70

Pregunta
70. What does the following code print to the screen?
Respuesta
  • 7
  • cout
  • int
  • world

Pregunta 71

Pregunta
71. What is the value of x after the following statements?
Respuesta
  • 15
  • 10
  • 5
  • 25

Pregunta 72

Pregunta
72. What is the value of x after the following statements?
Respuesta
  • 25
  • 4
  • 5
  • 1

Pregunta 73

Pregunta
73. What is the value of x after the following code executes?
Respuesta
  • 10
  • 11
  • 23
  • 13

Pregunta 74

Pregunta
74. Given the following code, what is the final value of i?
Respuesta
  • 5
  • 2
  • 3
  • 0

Pregunta 75

Pregunta
75. Given the following code, what is the final value of i?
Respuesta
  • 4
  • 6
  • 5
  • 0

Pregunta 76

Pregunta
76. Which of the following is the valid array declaration
Respuesta
  • int num(5)
  • int mycat[5]
  • Array. double[5] marks
  • Myarray.counter int[5]

Pregunta 77

Pregunta
77. What is the output of the following code?
Respuesta
  • 7
  • Value
  • 1
  • 6

Pregunta 78

Pregunta
78. What is the value of x after the following statements ?
Respuesta
  • 11
  • 10
  • 0
  • 12

Pregunta 79

Pregunta
79. What is the final output of the following code fragment ?
Respuesta
  • 22
  • 23
  • 20
  • 0

Pregunta 80

Pregunta
80. Solve the following piece of code and choose the best answer?
Respuesta
  • The function addition is called by passing the values
  • The function addition is called by passing reference
  • Both of above
  • None of above

Pregunta 81

Pregunta
81. If the type specifies of parameters of a function is followed by an ampersand &, that function call is…
Respuesta
  • Pass by value
  • Pass by reference
  • All of answers
  • None of answers

Pregunta 82

Pregunta
82. Which of the following gives the memory address of a pointer pt1?
Respuesta
  • *pt1;
  • pt1;
  • &pt1;
  • address(ptr1);

Pregunta 83

Pregunta
83. What is the value of x after the following statement?
Respuesta
  • 1.75
  • 50
  • 30
  • 20

Pregunta 84

Pregunta
84. What is the final value of x after the following fragment of codeexecutes ?
Respuesta
  • Infinite loop
  • Never
  • 1
  • 0

Pregunta 85

Pregunta
85. What is the value of x after the following statement?
Respuesta
  • 3.75
  • 1.75
  • 2
  • 0

Pregunta 86

Pregunta
86. What is the value of x after the following statements ?
Respuesta
  • 7
  • 10
  • 3
  • 33

Pregunta 87

Pregunta
87. What is the value of x after the following statements?
Respuesta
  • 70
  • 30
  • 3
  • 33

Pregunta 88

Pregunta
88. Given the following code fragment, what is the output
Respuesta
  • 5
  • That is all. Goodbye
  • X is bigger than 5
  • X

Pregunta 89

Pregunta
89. How many times is "Hi" printed to the screen ?
Respuesta
  • 0
  • 1
  • 14
  • 15

Pregunta 90

Pregunta
90. How to read file and take first string?
Respuesta

Pregunta 91

Pregunta
91. How to write to file?
Respuesta

Pregunta 92

Pregunta
92. There is given array with n elements, created as pointer. How to remove it correctly?
Respuesta
  • delete a;
  • delete[] a;
  • remove[] a;
  • remove a;

Pregunta 93

Pregunta
93. How to write correct recursive function for making sum of n numbers?

Pregunta 94

Pregunta
94. How to make several items in structure? Just think that you have “HOME”, and n items in it

Pregunta 95

Pregunta
95. Find mistake of next cod ?
Respuesta
  • No mistakes, it will just read from file and print first string in command line
  • Mistake in opening file, should be: file.open(“input.txt”);
  • It should write in other file; it can’t write directly to command line.
  • It should read from read from file, when we want to write in command line.

Pregunta 96

Pregunta
96. What will print in command line next code ?
Respuesta
  • Read first string from file “input.txt”, and print it in command line.
  • It will give an error, because, file should read in this way: file.open(“input.txt”);
  • It won’t print anything.
  • Read all lines and print it in new file.

Pregunta 97

Pregunta
97. Which one will be correct function for ?

Pregunta 98

Pregunta
98. There are given array “numbers” with 10 numbers. How to make sum of all numbers, which are located in odd indexes?

Pregunta 99

Pregunta
99. There is given string named “str”. How to print in command line length of str?
Respuesta
  • cout << str.count();
  • cout << str.length;
  • cout << str.lenth();
  • cout >> str.lenth();

Pregunta 100

Pregunta
100. How to implement array of chars with 10 elements?
Respuesta
  • char* chs; chs = new char(10);
  • char chs; chs = char[10];
  • char chs[10];
  • char chs[] = new char[10];

Pregunta 101

Pregunta
101. How to implement array of integer numbers with n elements, and how to delete them correctly?
Respuesta
  • int n; cin >> n; int* a; a = new% int[n]; delete[] a;
  • int n; cin >> n; int& a; a = new int[n]; delete[] a;
  • int n; cin >> n; int* a; a = new@ int[n]; delete[n] a;
  • int n; cin >> n; int* a; a = new& int[n]; for(int i=0; i<n; i++) delete a;

Pregunta 102

Pregunta
102. How to get whole string in one line (in command line)?
Respuesta
  • string s; getline(cin, s);
  • string s; getline(cout, s);
  • string s; cin >> s;
  • string s; cout << s;

Pregunta 103

Pregunta
103. How to get whole string in one line (in file)?
Respuesta
  • ifstream file; string s; getline(file, s);
  • ifstream file; string s; getline(cin, s);
  • ifstream file; string s; getline(cout, s);
  • ifstream file; string s; file >> s;

Pregunta 104

Pregunta
104. Why do we need library?
Respuesta
  • To work with strings.
  • To work with files.
  • To work with mathematical functions.
  • To work with our own libraries.

Pregunta 105

Pregunta
105. Why do we need library <cmath>?
Respuesta
  • To work with strings.
  • To work with mathematical functions.
  • To work with command line.
  • To work with our own libraries.

Pregunta 106

Pregunta
106. Where is the mistake of the code ?
Respuesta
  • Variable “a” do not have any values.
  • Library didn’t included.
  • Library didn’t included.
  • Library didn’t included

Pregunta 107

Pregunta
107. What will be printed in the part of the cod?
Respuesta
  • 1 4 7 10
  • 0 3 6 9
  • 3 6 9
  • 9 6 3 0

Pregunta 108

Pregunta
108. What will be printed in the part of the code?
Respuesta
  • 0 8 16 24 32
  • 2 10 18 26 34
  • 6 12 20 28 36
  • 4 10 18 26 34

Pregunta 109

Pregunta
109. Which of the following is the proper keyword to allocate memory?
Respuesta
  • new
  • malloc
  • create
  • value

Pregunta 110

Pregunta
110. Which of the following is the proper keyword to deallocate memory?
Respuesta
  • free
  • delete
  • clear
  • remove

Pregunta 111

Pregunta
111. Assume if A = 10; and B = 15; with using bitwise OR operator Find A||B
Respuesta
  • 10
  • 15
  • 61
  • 13

Pregunta 112

Pregunta
112. The notation of logical NOT operator in a C++ program is
Respuesta
  • !
  • :
  • ;
  • None of above

Pregunta 113

Pregunta
113. Which of the following denote C++ looping statement?
Respuesta
  • All of them
  • for
  • while
  • do-while

Pregunta 114

Pregunta
Cin in C++ program uses the operator
Respuesta
  • >>
  • <<
  • >
  • ||

Pregunta 115

Pregunta
What is the minimum number of times a do loop would definitely get executed?
Respuesta
  • 1
  • inf
  • 0
  • None of the above

Pregunta 116

Pregunta
The function named as exforsys declared as int exforsys(float x, double y) has return type as
Respuesta
  • int
  • char
  • double
  • string

Pregunta 117

Pregunta
Which of the following is mandatory for all C++ program?
Respuesta
  • main()
  • void()
  • system()
  • None of the above

Pregunta 118

Pregunta
Which of the following denote newline character in C++ program?
Respuesta
  • “\n”
  • end
  • “/n”
  • enl

Pregunta 119

Pregunta
Which of the following is used to group a set of objects and functions under a name?
Respuesta
  • namespace
  • name
  • namearea
  • areaname

Pregunta 120

Pregunta
What is the notation used to place block of statements in a looping structure in C++?
Respuesta
  • { }
  • [ ]
  • ( )
  • " "

Pregunta 121

Pregunta
What is the notation used show the size of array?
Respuesta
  • [ ]
  • { }
  • ( )
  • " "

Pregunta 122

Pregunta
How many values can be returned by a C++ function?
Respuesta
  • 1
  • Inf
  • 0
  • None of the above

Pregunta 123

Pregunta
123. Which of the following is returned by the system if a C++ program completes successfully?
Respuesta
  • 0
  • 1
  • -1
  • Inf

Pregunta 124

Pregunta
124. The variables that can be used only within the function in which it is declared is called as
Respuesta
  • local
  • global
  • both of them
  • none of them

Pregunta 125

Pregunta
125. Comments in C++ program is written by using
Respuesta
  • //
  • --
  • <!-->
  • <>

Pregunta 126

Pregunta
126. The array exforsys[10] can be declared using pointers as
Respuesta
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Pregunta 127

Pregunta
127. Default size of int in c++ (in bytes)
Respuesta
  • 4
  • 8
  • 16
  • 2

Pregunta 128

Pregunta
128. Default size of double in c++ (in bytes)
Respuesta
  • 16
  • 8
  • 4
  • 2

Pregunta 129

Pregunta
129. Default value of boolean
Respuesta
  • false
  • true

Pregunta 130

Pregunta
130. If a function in C++ does not return a value then its return type is denoted as
Respuesta
  • void
  • int
  • double
  • bool

Pregunta 131

Pregunta
131. A user defined header file is included by following statement in general.
Respuesta
  • #include "file.h"
  • #include <file.h>
  • #include file.h
  • #include <file>

Pregunta 132

Pregunta
132. An inline function can execute faster than a normal function.
Respuesta
  • True
  • False

Pregunta 133

Pregunta
133. What value must a destructor return?
Respuesta
  • Destructors do not return a value.
  • A pointer to the class.
  • An object of the class.
  • A status code determining whether the class was destructed correctly

Pregunta 134

Pregunta
134. What character ends all strings?
Respuesta
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Pregunta 135

Pregunta
135. Which of the following reads in a string named x with one hundred characters?
Respuesta
  • cin.getline(x, 100, &#39;\n&#39;);
  • cin.getline(100, x, &#39;\n&#39;);
  • readline(x, 100, &#39;\n&#39;);
  • read(x);

Pregunta 136

Pregunta
136. Which of the following functions compares two strings?
Respuesta
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Pregunta 137

Pregunta
137. Which of the following adds one string to the end of another?
Respuesta
  • strcat();
  • append();
  • stradd();
  • stringadd();

Pregunta 138

Pregunta
138. Which of the following correctly declares an array?
Respuesta
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Pregunta 139

Pregunta
139. What is the index number of the last element of an array with 29 elements?
Respuesta
  • 28
  • 29
  • 0
  • 27

Pregunta 140

Pregunta
140. Which of the following is a two-dimensional array?
Respuesta
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Pregunta 141

Pregunta
141. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
Respuesta
  • foo[6]
  • foo[7]
  • foo(6)
  • foo

Pregunta 142

Pregunta
142. Which of the following accesses a variable in structure b?
Respuesta
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Pregunta 143

Pregunta
143. Which of the following accesses a variable in structure *b?
Respuesta
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Pregunta 144

Pregunta
144. Which of the following is a properly defined struct?
Respuesta
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Pregunta 145

Pregunta
145. Which properly declares a variable of struct foo?
Respuesta
  • foo var
  • struct foo
  • foo
  • int foo

Pregunta 146

Pregunta
146. Which of the following is the proper declaration of a pointer?
Respuesta
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Pregunta 147

Pregunta
147. Which of the following gives the memory address of integer variable a?
Respuesta
  • &amp;a;
  • *a;
  • address(a);
  • a;

Pregunta 148

Pregunta
148. Which of the following gives the value stored at the address pointed to by the pointer a?
Respuesta
  • *a;
  • &amp;a;
  • a;
  • val(a);

Pregunta 149

Pregunta
149. Which of the following is the proper keyword to allocate memory?
Respuesta
  • new
  • malloc
  • create
  • value

Pregunta 150

Pregunta
150. Which of the following is the proper keyword to deallocate memory?
Respuesta
  • delete
  • clear
  • remove
  • free

Pregunta 151

Pregunta
151. What is the notation used to place block of statements in a looping structure in C++?
Respuesta
  • { }
  • [ ]
  • ( )
  • " "

Pregunta 152

Pregunta
152. What is the notation used show the size of array?
Respuesta
  • [ ]
  • { }
  • ( )
  • " "

Pregunta 153

Pregunta
153. How many values can be returned by a C++ function?
Respuesta
  • 1
  • Inf
  • 0
  • None of the above

Pregunta 154

Pregunta
154. Which of the following is returned by the system if a C++ program completes successfully?
Respuesta
  • 0
  • 1
  • -1
  • Inf

Pregunta 155

Pregunta
155. The variables that can be used only within the function in which it is declared is called as
Respuesta
  • local
  • global
  • both of them
  • none of them

Pregunta 156

Pregunta
156. Comments in C++ program is written by using
Respuesta
  • //
  • --
  • <!-->
  • <>

Pregunta 157

Pregunta
157. The array exforsys[10] can be declared using pointers as
Respuesta
  • * exforsys[ ]
  • exforsys[ ]
  • $exforsys[ ]
  • &amp;exforsys[ ]

Pregunta 158

Pregunta
158. Default size of int in c++ (in bytes)
Respuesta
  • 4
  • 8
  • 16
  • 2

Pregunta 159

Pregunta
159. Default size of double in c++ (in bytes)
Respuesta
  • 16
  • 8
  • 4
  • 2

Pregunta 160

Pregunta
160. Default value of boolean
Respuesta
  • false
  • true

Pregunta 161

Pregunta
161. If a function in C++ does not return a value then its return type is denoted as
Respuesta
  • void
  • int
  • double
  • bool

Pregunta 162

Pregunta
162. A user defined header file is included by following statement in general.
Respuesta
  • #include “file.h”
  • #include <file.h>
  • #include file.h
  • #include <file>

Pregunta 163

Pregunta
163. An inline function can execute faster than a normal function.
Respuesta
  • True
  • False

Pregunta 164

Pregunta
164. What value must a destructor return?
Respuesta
  • Destructors do not return a value.
  • A pointer to the class.
  • An object of the class.
  • A status code determining whether the class was destructed correctly

Pregunta 165

Pregunta
165. What character ends all strings?
Respuesta
  • ‘\o’
  • ‘\n’
  • ‘’
  • ‘.’

Pregunta 166

Pregunta
166. Which of the following reads in a string named x with one hundred characters?
Respuesta
  • cin.getline(x, 100, &#39;\n&#39;);
  • cin.getline(100, x, &#39;\n&#39;);
  • readline(x, 100, &#39;\n&#39;);
  • read(x);

Pregunta 167

Pregunta
167. Which of the following functions compares two strings?
Respuesta
  • strcmp();
  • cmp();
  • stringcompare();
  • compare();

Pregunta 168

Pregunta
168. Which of the following adds one string to the end of another?
Respuesta
  • strcat();
  • append();
  • stradd();
  • stringadd();

Pregunta 169

Pregunta
169. Which of the following correctly declares an array?
Respuesta
  • int anarray[10];
  • int anarray;
  • anarray{10};
  • array anarray[10];

Pregunta 170

Pregunta
170. What is the index number of the last element of an array with 29 elements?
Respuesta
  • 28
  • 29
  • 0
  • 27

Pregunta 171

Pregunta
171. Which of the following is a two-dimensional array?
Respuesta
  • int anarray[20][20];
  • array anarray[20][20];
  • int array[20, 20];
  • char array[20];

Pregunta 172

Pregunta
172. Which of the following correctly accesses the seventh element stored in foo, an array with 100 elements?
Respuesta
  • foo[6]
  • foo[7]
  • foo(6)
  • foo

Pregunta 173

Pregunta
173. Which of the following accesses a variable in structure b?
Respuesta
  • b.var
  • b-&gt;var
  • b-var
  • b&gt;var

Pregunta 174

Pregunta
174. Which of the following accesses a variable in structure *b?
Respuesta
  • b-&gt;var
  • b.var
  • b-var
  • b&gt;var

Pregunta 175

Pregunta
175. Which of the following is a properly defined struct?
Respuesta
  • struct a_struct {int a;};
  • struct a_struct {int a;}
  • struct {int a;}
  • struct a_struct int a;

Pregunta 176

Pregunta
176. Which properly declares a variable of struct foo?
Respuesta
  • foo var
  • struct foo
  • foo
  • int foo

Pregunta 177

Pregunta
177. Which of the following is the proper declaration of a pointer?
Respuesta
  • int *x;
  • int &amp;x;
  • ptr x;
  • int x;

Pregunta 178

Pregunta
178. Which of the following gives the memory address of integer variable a?
Respuesta
  • &a;
  • *a;
  • address(a);
  • a;

Pregunta 179

Pregunta
179. Which of the following gives the value stored at the address pointed to by the pointer a?
Respuesta
  • *a;
  • &amp;a;
  • a;
  • val(a);

Pregunta 180

Pregunta
180. Which of the following is the proper keyword to allocate memory?
Respuesta
  • new
  • malloc
  • create
  • value

Pregunta 181

Pregunta
1. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; ( b * a + c *d --);
Respuesta
  • 26
  • 24
  • 22
  • 28

Pregunta 182

Pregunta
181. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (++d);
Respuesta
  • 6
  • 5
  • 1
  • 4

Pregunta 183

Pregunta
182. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = d + c++);
Respuesta
  • 9
  • 10
  • 8
  • 4

Pregunta 184

Pregunta
183. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = d + ++c);
Respuesta
  • 10
  • 9
  • 4
  • 8

Pregunta 185

Pregunta
2. In a class definition, the special method provided to be called to create an instance of that class is known as a/an
Respuesta
  • Constructor
  • Destructor
  • Object
  • Compiler

Pregunta 186

Pregunta
184. ……………….. are used to document a program and improve its readability.
Respuesta
  • Comments
  • Keywords
  • Control structures
  • Blocks

Pregunta 187

Pregunta
185. Members of a class specified as ……………….. are accessible only to methods of that class. 
Respuesta
  • private
  • public
  • protected
  • none of them

Pregunta 188

Pregunta
186. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; ( --b * a + c *d --);
Respuesta
  • 24
  • 21
  • 22
  • 28

Pregunta 189

Pregunta
187. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (a++);
Respuesta
  • 2
  • 1
  • Syntax error
  • 3

Pregunta 190

Pregunta
188. Use the following declaration and initialization to evaluate the Java expressions int a = 2, b = 3, c = 4, d = 5; cout &lt;&lt; (c = c++);
Respuesta
  • 4
  • 5
  • 8
  • 2

Pregunta 191

Pregunta
189. Identify, from among the following, the incorrect variable name
Respuesta
  • 2ndName
  • _theButton
  • my2ndFont.
  • CurrentWeatherStateofplanet

Pregunta 192

Pregunta
190. An overloaded method consists of: i) The same method name with different types of parameters ii) The same method name with different number of parameters iii) The same method name and same number and type of parameters
Respuesta
  • Both i and ii
  • all of them
  • none of them
  • only i

Pregunta 193

Pregunta
191. You read the following statement in a C++ program that compiles and executes. submarine.dive(depth); What can you say for sure?
Respuesta
  • dive must be a method.
  • depth must be an int
  • submarine must be the name of a class
  • submarine must be a method.

Pregunta 194

Pregunta
192. What is the type and value of the following expression? - 4 + 1/2 + 2*-3 + 5.0
Respuesta
  • double -5.0
  • int -5
  • double -4.5
  • none of the above

Pregunta 195

Pregunta
193. What is printed by the following statement? cout &lt;&lt; (“Hello,\nworld!”);
Respuesta
  • Hello, world!
  • Hello, \nworld!
  • Hello, world
  • “Hello, \nworld!”

Pregunta 196

Pregunta
194. Which of the following variable declaration would NOT compile in a java program?
Respuesta
  • int 1_var;
  • int var_1;
  • int var;
  • int VAR;

Pregunta 197

Pregunta
3. _________ is a paradigm based on the concepts of “object” that contains data and methods
Respuesta
  • Object-oriented programming
  • Object-based programming
  • Data-oriented programming
  • Method-oriented programming

Pregunta 198

Pregunta
195. Two or more methods with same name in the same class with different arguments is called as
Respuesta
  • Method overloading
  • Method overriding
  • Method overridden
  • none of the above

Pregunta 199

Pregunta
196. Constructors are used to
Respuesta
  • Initialize a newly create object.
  • Free memory
  • To create a subclass
  • To build a user interface

Pregunta 200

Pregunta
197. Syntax of loop for (declaration; condition; increment/decrement){}
Respuesta
  • False
  • True
Mostrar resumen completo Ocultar resumen completo

Similar

State & Local Govt - Budgetary Accounting
turquoise_cat
Liberalism Mindmap
floragair
3. Describe the state of nature for Hobbes, Locke, and Rousseau.
Elisabeth Morell
Woody, Alternate, Simple, Families F-R
Wes Smalley
body parts and sickness
Ambre Badipi
types of economy
Jesse McNab
War on Terror
Wesley Spearman
React siblings components
Kostas Diakogiannis
Liberalism Mindmap
hollie garner
United States Capitals
Rob Perry
Secularism
Selective Study