ELEC 376 Final 2018 Flashcards
C++ is the first programming language to create .o or object files as part of its compilation process
F
Global variables cannot be declared in a C++ program
F
A C++ style variable declaration uses assignment = instead of ()
F
Unlike Java, there are many different C++ compilers in use
T
The GCC compiler that we have been using throws an exception if an attempt is made to divide a double by zero
F
In C++ you can assign your own choice of integer values to members of an enum
T
The final keyword is used to declare a constant
F
The keyword “auto” can be used to type a variable during declaration even if it is not assigned a value in the declaration
F
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>
T
A C-Style cast will preserve the const property of a variable
F
A reference can be null
F
static_cast is a templated operator
T
The “address of” operator, &, is used on the LHS of an assignment statement
F
Indirection is the process of obtaining a value by dereferencing a pointer
T
You cannot create a reference to an int type variable
F
The statement int* x, y, z; creates three pointers to an int
F
Memory address locations cannot be obtained in C++
F
A pointer does not occupy any memory
F
The * operator is used to dereference a pointer, when it is on the RHS of an assignment operator
T
A 2D array of int could be typed as **int
T
A “pointer to a constant” is the same thing as a “constant pointer”
F
When used with a pointer, the -> operator provides dereferencing and membership
T
A parameter can be declared to be a constant reference to a constant pointer by using the const keyword twice
T
In C++11 or later, a struct can be assigned using an initializer list in {}
T
An assignment operator does not normally return anything
F
The boolean bit-wise operator | is the logical equivalent of a XOR
F
In a conditional statement, non-zero integers are considered to be “true”
T
A pointer that is nullptr is considered to be false
T
The select path of a switch statement will work with String objects
F
A goto statement will work in C++
T
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
T
Vector elements are mutable (can be re-assigned) whether they are accessed using [] or the .at() member function
T
A string object from the STL is an immutable object - characters in the string cannot be changed without re-assigning the string
F
String objects can be compared directly using boolean operators like >, == and <
T
An ifstream object can be created using a file that does no exist
T
The .fail() member function can be used with an ofstream object to make sure that a file was successfully opened for output
T
The «_space;operator can be used to write to a file
T
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
F
The membership operator :: can be used to associate members with namespaces or functions with classes for implementation
T
A default constructor is invoked with an empty set of ()
F
Only classes that are extended from exception can be thrown with the throw command
F
An exception object should be caught by reference in a try/catch block
T
It is a standard practice for a function to return a pointer to a variable defined within the function
F
A static local variable is only initialized once, regardless of how many times the function containing this variable is invoked
T
Default function arguments are assigned in the implementation, or *.cpp, file
F
A parameter of type std::initializer_list<int> would accept {4, 5, 7, 9} as an argument</int>
T
The string class overloads the boolean operators including >, >=, ==, !=, < and <=
T
The new and delete operators can be overloaded in C++
T
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
F
C++ allows you to change the order of precedence of overloaded operators
F
Operators can only be overloaded as non member functions
F
friend functions can access the private attributes of the class instance of which they are a member
F
friend functions can access the private attributes of any arguments supplied to the function
F
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
T
A non-member overloading of a binary operator must have two arguments
T
If an overloaded binary operator is to be used in mixed type expressions the class has to supply conversion constructors
F
Any overloaded assignment operator functions have to be written as member functions
T
Stream operators»_space; and «_space;cannot be overloaded
F
A function that overloads the post increment ++ operator requires an unused int type parameter to differentiate it from the pre-increment version
T
A pre-increment overloaded function will run faster than a post-increment one
T
The constexpr keyword is used to help with code optimization, which is all about reducing execution time
T
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
T
Two overloadings are required for the operator [] if the class is to be mutable
T
inline functions should not be used because they will slow down program compilation
F
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
T
The compiler supplied operator= overloading just does a direct assignment of attributes in the order in which they have been declared
T
The notation “-=delete” can be used to disable the use of the function to which it is attached
T
Nested namespaces are a feature of C++98
F
Repeated function calls mixed with function completions cause stack memory to be overwritten
T
A pointer to a local variable created on the heap will be stable after being returned by the function in which it was created
T
An overloading of the assignment operator is one of the so-called “Big Three”
T
If a deleted pointer is then assigned to nullptr, nothing “bad” will happen if an attempt is made to delete the pointer again
T
A memory leak results from the use of a 32 bit compiler on a 64 bit computer
F
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”
T
Deleting an uninitialized pointer is a bad idea
T
Passing a child object by value into a function using a parameter of a parent class type will result in object slicing
T
A real copy constructor is responsible for deleting any attributes using the heap before the copy operation is carried out
F
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
T
An overloaded assignment operator member function is responsible for deleting any attributes in the class that use the heap
T
The parent class access specifier used in the child class can be used to reduce the access of members inherited from the parent class
T
A parent class function that will be used to provide polymorphism must be declared as virtual
T
A child class can overload a non-virtual inherited function by using the same function name and changing the parameter list
F
A class that contains even one pure virtual function cannot be instantiated
T
Static binding take place at compilation and is determined by the declared pointer type
T
Constructors and destructors are not inherited by a child class
T
Templated functions are typed at compilation only, not while the program is running
T
It is important to have a virtual destructor in the root class of hierarchy even if it is empty
T
Managed C++/CLI code uses handles instead of pointers and gcnew instead of new
T
in C++/CLI the acronym CTS stands for the common template system
F
In C++/CLI the CLS rules specify that each .NET language defines its own atomic types
F
An agile programming team expects to be coding, designing and testing all at the same time
T
A sprint should always end up producing a demonstrable deliverable at the end of the sprint
T
A burndown chart typically shows the progress and completion of all of your sprints at once
F
Most agile teams will operate with at least two sprints underway at the same time in the same project
F
A user story type issue is usually broken down into sub-tasks before it is added to a sprint
T
A user story is used to express a requirement
T
User stories cannot be used to express non functional requirements
F
A scrum is a meeting where programmers gather together for a team programming session that can last hours
F
A burndown chart is useless unless team members provide time to completion estimates for tasks and record their progress
T
Pair programming takes place with just one person coding and the other watching over their shoulder
T
Task type issues that are not completed in a sprint should return to the backlog
T
Unfortunately the SCRUM methodology does not allow you to prioritize issues
It is considered good practice to determine non functional requirements after software has been designed to satisfy the functional requirements.
F
Modern repositories do not carry out version control
F
A git repository allows you to keep using the repository even when you do not have an internet connection for an extended period
T
Everyone using a git repository has a local copy of the repository
T
It is useful to create branches in a git repository as a means of reducing merge conflicts
T
Conflict resolution software allows you to resolve merge conflicts for binary files
F
A git clone operation can only create an empty repository on your computer
F
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
T
A UML sequence diagram is a snapshot of the state of the system at a certain time
F
In a UML sequence diagram an actor can only interact with a control object through a boundary object
T
A closed architecture forces you to only have a single layer of abstraction in your system design
F
The process of software analysis results in a model that can only be expressed using static diagrams such as a class diagram
F
A closed architecture forces you to only have a single layer of abstraction in your system design
F
Good system design leads to strong cohesion within subsystems and weak coupling between subsystems.
T
A CRC card will contain the class name along with all the class members - attributes and member functions
F
There is no practical limit to the number of system layers that can be created through a partitioning process
F
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.
T
System design goals are extracted from a list of functional requirements
F
This exam has too many true/false questions!!
HAHAHA FUCK YOU STUPID PROF YOU ARENT FUNNY