Quiz
GAME1001 Object Oriented Programming
Este quiz tem tempo limite, por isso abre no player de sempre.
Perguntas do quiz (15)
1A default constructor is one that takes _____ arguments. It is automatically called when an object is _________.
- Ano, destroyed
- Bno, created
- Cone, destroyed
- Done, created
- Eas many as you want, destroyed
2What is an abstract data type?
- AAre programmer created data types
- BAre Function created data types
- CStands for ADR
- DAllows a programmer to design a solution
- ENone of the above
3What will the following statement print out?
int score[ ] = { 14, 55, 44 };
cout << *score;- AThis will not work
- B14
- C55
- D44
- ENone of the above
4What is a C-String terminated by? (MORE THAN ONE CAN BE CORRECT)
- AA NULL character
- BTerminated by \0
- Ca sequence of numbers
- DTerminated by NULL
- ENone of the above
5Select an example of a constructor for class LOTile:
- ALOTile()
- BLOTile() { }
- C~LOTile() { }
- DLOTile { }
- ELOTile LOTile();
6What will this statement print?
int num = 5;
int* numptr;
numptr = #
cout << numptr << endl;- AThe address of num variable
- BThe address of numptr uninitialized
- C5
- DThis program will not work
- ENone of the above
7How can we change this program so that the statement changes the original variable num in main?
void setNum(int num)
{ num = 5; }
int main() {
int num;
}- Avoid setNum(int &num)
- Bvoid setNum(int num);
- Cthis->num = num;
- Dnum = 8;
- ENone of the above
8What will this print out?
int num = 2;
int score[] = { 66, 64, 100, 90 };
cout << *(score + num);- A100
- B66
- C64
- D90
- EThis program will not work
9What will this for loop print? (int score[4] = { 30, 34, 11, 90 };
for (int i = 0; i < 4; i++)
if (i % 3 == 0)
else
cout << *(score + i) << " ";- A30 34 11 90
- B30 34 11
- C34 11 90
- D30 34 90
- EThis program will not work
10What does "\b" do?
- Amoves the cursor back one space
- Bmoves the cursor forward one space
- Cstarts a new line
- DThis is not a real function statement
- ENone of the above
11What are access specifiers? (MORE THAN ONE CAN BE CORRECT)
- Aexample; private:
- Bmeans to restrict data access
- Cpart of object oriented programming
- Dan example is +=
- ENone of the above
12Which of the following is the correct way to create an object via pointers and vectors? (The class name Circle)
- Avector <int> Circle = new Circle;
- Bvector <Circle*> circle;
- Cvector <Circle*> Circle
- Dvector <Circle*> = new circle();
- Evector <Circle*> = new circle
13Linked lists work like arrays, except in simple terms they require pointers
- AVerdadeiro
- BFalso
14File writing can be done with ifstream, ofstream or fstream
- AVerdadeiro
- BFalso
15If a variable is uninitialized in a class, c++ will give you an error
- AVerdadeiro
- BFalso
Informações
- Descrição
- Intro to Programming - GAME1001 Quiz sobre GAME1001 Object Oriented Programming, criado por Liam Blake em 27-03-2019.
- Autor
- Liam Blake
- Idioma
- English
- Visualizações
- 1
- Etiquetas
- Avaliação
- Ainda sem avaliações Avalie este quiz