ELEC 376 Final 2018 Flashcards

1
Q

C++ is the first programming language to create .o or object files as part of its compilation process

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Global variables cannot be declared in a C++ program

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A C++ style variable declaration uses assignment = instead of ()

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Unlike Java, there are many different C++ compilers in use

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

The GCC compiler that we have been using throws an exception if an attempt is made to divide a double by zero

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In C++ you can assign your own choice of integer values to members of an enum

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The final keyword is used to declare a constant

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

The keyword “auto” can be used to type a variable during declaration even if it is not assigned a value in the declaration

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

If a numeric literal has the suffix “i” at the end of the number it will be identified as the type std::complex<double></double>

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

A C-Style cast will preserve the const property of a variable

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A reference can be null

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

static_cast is a templated operator

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The “address of” operator, &, is used on the LHS of an assignment statement

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Indirection is the process of obtaining a value by dereferencing a pointer

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

You cannot create a reference to an int type variable

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

The statement int* x, y, z; creates three pointers to an int

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Memory address locations cannot be obtained in C++

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A pointer does not occupy any memory

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The * operator is used to dereference a pointer, when it is on the RHS of an assignment operator

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

A 2D array of int could be typed as **int

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A “pointer to a constant” is the same thing as a “constant pointer”

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

When used with a pointer, the -> operator provides dereferencing and membership

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

A parameter can be declared to be a constant reference to a constant pointer by using the const keyword twice

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

In C++11 or later, a struct can be assigned using an initializer list in {}

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

An assignment operator does not normally return anything

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

The boolean bit-wise operator | is the logical equivalent of a XOR

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

In a conditional statement, non-zero integers are considered to be “true”

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

A pointer that is nullptr is considered to be false

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

The select path of a switch statement will work with String objects

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

A goto statement will work in C++

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Accessing an element in a vector using [] with an index value that is outside the bounds of the vector results in “undefined” behaviour and no exception is thrown

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Vector elements are mutable (can be re-assigned) whether they are accessed using [] or the .at() member function

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

A string object from the STL is an immutable object - characters in the string cannot be changed without re-assigning the string

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

String objects can be compared directly using boolean operators like >, == and <

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

An ifstream object can be created using a file that does no exist

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

The .fail() member function can be used with an ofstream object to make sure that a file was successfully opened for output

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

The &laquo_space;operator can be used to write to a file

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

If const is used at the end of a function prototype it is a promise that the function will no change the arguments provided to the function

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

The membership operator :: can be used to associate members with namespaces or functions with classes for implementation

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

A default constructor is invoked with an empty set of ()

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

Only classes that are extended from exception can be thrown with the throw command

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

An exception object should be caught by reference in a try/catch block

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

It is a standard practice for a function to return a pointer to a variable defined within the function

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

A static local variable is only initialized once, regardless of how many times the function containing this variable is invoked

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

Default function arguments are assigned in the implementation, or *.cpp, file

A

F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

A parameter of type std::initializer_list<int> would accept {4, 5, 7, 9} as an argument</int>

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

The string class overloads the boolean operators including >, >=, ==, !=, < and <=

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

The new and delete operators can be overloaded in C++

A

T

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

A binary operator overloaded in a class requires that an instance of the class be supplied for both operands of the operator in the function prototype

47
Q

C++ allows you to change the order of precedence of overloaded operators

48
Q

Operators can only be overloaded as non member functions

49
Q

friend functions can access the private attributes of the class instance of which they are a member

50
Q

friend functions can access the private attributes of any arguments supplied to the function

51
Q

friend functions can access the private attributes of arguments supplied to the function, as long as they are of the same type as the class in which the friend function has been declared

52
Q

A non-member overloading of a binary operator must have two arguments

53
Q

If an overloaded binary operator is to be used in mixed type expressions the class has to supply conversion constructors

54
Q

Any overloaded assignment operator functions have to be written as member functions

55
Q

Stream operators&raquo_space; and &laquo_space;cannot be overloaded

56
Q

A function that overloads the post increment ++ operator requires an unused int type parameter to differentiate it from the pre-increment version

57
Q

A pre-increment overloaded function will run faster than a post-increment one

57
Q

The constexpr keyword is used to help with code optimization, which is all about reducing execution time

58
Q

The presence in the same class of a conversion operator and a conversion constructor using the same type will lead to an ambiguity unless the explicit keyword is used

59
Q

Two overloadings are required for the operator [] if the class is to be mutable

60
Q

inline functions should not be used because they will slow down program compilation

61
Q

The use of the explicit keyword will make sure that an overloaded conversion operator is only used in mixed type expressions, and not in a casting operation

62
Q

The compiler supplied operator= overloading just does a direct assignment of attributes in the order in which they have been declared

63
Q

The notation “-=delete” can be used to disable the use of the function to which it is attached

64
Q

Nested namespaces are a feature of C++98

65
Q

Repeated function calls mixed with function completions cause stack memory to be overwritten

66
Q

A pointer to a local variable created on the heap will be stable after being returned by the function in which it was created

67
Q

An overloading of the assignment operator is one of the so-called “Big Three”

68
Q

If a deleted pointer is then assigned to nullptr, nothing “bad” will happen if an attempt is made to delete the pointer again

69
Q

A memory leak results from the use of a 32 bit compiler on a 64 bit computer

70
Q

If you have two pointers aliased to the same object on a heap and one pointer is supplied to a delete command, then the second pointer will be deemed “unstable”

71
Q

Deleting an uninitialized pointer is a bad idea

72
Q

Passing a child object by value into a function using a parameter of a parent class type will result in object slicing

73
Q

A real copy constructor is responsible for deleting any attributes using the heap before the copy operation is carried out

74
Q

A real copy constructor is also responsible for preventing the aliasing of any pointers, which is what would happen if the compiler generated copy constructor is used instead

75
Q

An overloaded assignment operator member function is responsible for deleting any attributes in the class that use the heap

76
Q

The parent class access specifier used in the child class can be used to reduce the access of members inherited from the parent class

76
Q

A parent class function that will be used to provide polymorphism must be declared as virtual

76
Q

A child class can overload a non-virtual inherited function by using the same function name and changing the parameter list

76
Q

A class that contains even one pure virtual function cannot be instantiated

76
Q

Static binding take place at compilation and is determined by the declared pointer type

76
Q

Constructors and destructors are not inherited by a child class

76
Q

Templated functions are typed at compilation only, not while the program is running

77
Q

It is important to have a virtual destructor in the root class of hierarchy even if it is empty

78
Q

Managed C++/CLI code uses handles instead of pointers and gcnew instead of new

79
Q

in C++/CLI the acronym CTS stands for the common template system

80
Q

In C++/CLI the CLS rules specify that each .NET language defines its own atomic types

81
Q

An agile programming team expects to be coding, designing and testing all at the same time

82
Q

A sprint should always end up producing a demonstrable deliverable at the end of the sprint

83
Q

A burndown chart typically shows the progress and completion of all of your sprints at once

84
Q

Most agile teams will operate with at least two sprints underway at the same time in the same project

85
Q

A user story type issue is usually broken down into sub-tasks before it is added to a sprint

86
Q

A user story is used to express a requirement

87
Q

User stories cannot be used to express non functional requirements

88
Q

A scrum is a meeting where programmers gather together for a team programming session that can last hours

88
Q

A burndown chart is useless unless team members provide time to completion estimates for tasks and record their progress

89
Q

Pair programming takes place with just one person coding and the other watching over their shoulder

89
Q

Task type issues that are not completed in a sprint should return to the backlog

89
Q

Unfortunately the SCRUM methodology does not allow you to prioritize issues

89
Q

It is considered good practice to determine non functional requirements after software has been designed to satisfy the functional requirements.

89
Q

Modern repositories do not carry out version control

89
Q

A git repository allows you to keep using the repository even when you do not have an internet connection for an extended period

90
Q

Everyone using a git repository has a local copy of the repository

90
Q

It is useful to create branches in a git repository as a means of reducing merge conflicts

91
Q

Conflict resolution software allows you to resolve merge conflicts for binary files

91
Q

A git clone operation can only create an empty repository on your computer

91
Q

It is always good practice to supply a comment when making a file commit to a reposition as a means of providing a reason for the commit

91
Q

A UML sequence diagram is a snapshot of the state of the system at a certain time

91
Q

In a UML sequence diagram an actor can only interact with a control object through a boundary object

91
Q

A closed architecture forces you to only have a single layer of abstraction in your system design

91
Q

The process of software analysis results in a model that can only be expressed using static diagrams such as a class diagram

91
Q

A closed architecture forces you to only have a single layer of abstraction in your system design

91
Q

Good system design leads to strong cohesion within subsystems and weak coupling between subsystems.

91
Q

A CRC card will contain the class name along with all the class members - attributes and member functions

91
Q

There is no practical limit to the number of system layers that can be created through a partitioning process

91
Q

A team that divides itself up to work on subsystems should at the same time create a plan for and assign responsibility to someone to carry out system integration.

92
Q

System design goals are extracted from a list of functional requirements

93
Q

This exam has too many true/false questions!!

A

HAHAHA FUCK YOU STUPID PROF YOU ARENT FUNNY