Docsity

CMPE 320 Final Exam, Exams of Nursing

Partial preview of the text

Download CMPE 320 Final Exam and more Exams Nursing in PDF only on Docsity!

CMPE 320 Final Exam ( Updated 2025

) 1 100 Complete Questions &

Answers

(Solved) 100% Correct

The new[] operatr can be used in a try/catch block so that code can check for a failure of heap allocation - ANSWER-True The compiler will provide an error if you try to use delete instead of delete[] to delete an array - ANSWER-False The delete[] operator also automatically deletes all array elements

ANSWER-True

The destructor is never invoked directly in code - ANSWER-True A memory leak is caused by attempts to use uninitialized variables - ANSWER-False NO error will occur if a pointer that has been set to nullptr is deleted - ANSWER-True An attempt to delete an uninitialized pointer will result in 'unspecified behavior' - ANSWER-True Object slicing is caused by an attempt to de-reference a parent type pointer and hten to store it in a child type vairable - ANSWER-False A failed static_cast produces a nullptr - ANSWER- False Very few compilers have fully implemented the C++ 11 standard - ANSWER-False The first stage of compilation of a *.cpp file is the generation of the *.exe executable file - ANSWER-False

You must use the new operator to declare an array in c++ - ANSWERFalse C++ will initialize all the array positions of a nujmeric type array to zero upon declaration - ANSWER-False Array elements can be accessed without using [] - ANSWER-true An array will throw an exception if an attempt is made to access one position past the end of the array - ANSWERFalse You cannot build the equivalent to a struct using a normal C++ class - ANSWER-False It is more efficeint to use a bitwise shift operator, >>, than to use / when you are dividing an integer by a number that is a poer of two. - ANSWER-True In C++ the assignment operator, =, returns the value being assigned. - ANSWER-True

Non-zero integer values are evaluated as true in a Boolean expression - ANSWER-True A pointer to a constant is the saem thing as a constant pointer - ANSWER-False It is not necessary to pass an argument into a function by constant value

  • ANSWER-True It is always preferable to pass an object-type argument by constant reference - ANSWER-True The goto statement does not work in a C++ program - ANSWER-False The string class from the STL is a mutable object - ANSWER-True The brackets, [], can be used to alter or obtain elements from a vector - ANSWER-True The vector .at() member function can be invoked on the LHS of an assignment operator - ANSWER-True

Functions can be passed into other functions using a function pointer - ANSWER-True The new operator can be overloaded - ANSWER-True A binary operator can be overloaded in such a way that it becomes a unary operator - ANSWER-False All operators must be overloaded as memberf unctions - ANSWER-False For an object to be used on either side of a binary operator, that operator must be overloaded as a nonmember function in the object's class definition - ANSWER-True friend non-member functions need to use accessors to obtain attribute vales for arguments of the type they are 'friends' with - ANSWER- False The use of teh explicit keyword prevents a constructor from being used as a conversion operator - ANSWERTrue

An ambiguity can result from the presence of a conversion constructor and an overloaded conversion operator in the same class. - ANSWERTrue Inline functions must be declared as static - ANSWER- False Inline functions must be declared and implemented in the declaration, or 'header' file - ANSWER-True A function object can be created by overloading conversion constructors

  • ANSWER-False Binary program instructions are also stored in dynamic memory, which is also referred to as the 'heap' - ANSWER-False The size of teh stack is determined by the amount of available RAM on a computer - ANSWER-False The new operator must be used to place an object on the heap - ANSWER-True The new operator provides a reference to the object placed on teh heap -

A C++ class cannot extend more than one parent class - ANSWER-False A member function declared as 'final' in a parent class cannot be overridden in the child class - ANSWER-True The C++11 override keyword alerts the compiler to your intention to override an inherited function wiht the one to which you are adding the keyword - ANSWER-True Pointers to objects of a parent class type can morph to point to objects of the child class type at runtime - ANSWER-True

A class containing a pure virtual function cannot be instantiated - ANSWER-True A class containing a pure virtual function can be used as a parameter type whne passing by value - ANSWER-False You can pass a child type object argument by value to a parent type parameter - ANSWER-False A failed dynamic_cast produces a nullptr - ANSWER-True A child class can overload functions inherited from a parent class

ANSWER-False The virtual destructor in a child class must always invoke the virtual destructor in the parent class - ANSWER-False An overloaded operator= function in a parent class will be inherited by a child class. - ANSWER-False Destroying a child class object will first create a call to the parent class' destructor. - ANSWER-False

templated class can infer the desired type at runtime. - ANSWER- False ou do not have to explicitly delete a smart pointer like auto_ptr - ANSWER-True Multiple smart pointers cannot be aliased to the same object. - ANSWER-True A smart pointer is automatically deleted when it is out of scope. - ANSWER-True Elements of a smart pointer type in a vector still need to be deleted one at a time. - ANSWER-False In the SCRUM methodology, a User Story is used to describe requirements. - ANSWER-True A functional requirement is used to describe "how well" a non- functional requirement needs to be implemented. - ANSWER- False A sprint always lasts from the beginning of a project to the end of the project, when the product is complete - ANSWER-False

A User Story needs to be verifiable. - ANSWER-True Issues assigned to sprints are used to form a product backlog. - ANSWER-False Story points can be used instead of time estimates for task completion - ANSWER-True Only git repositories provide version control. - ANSWER- False A git repository is based on the use of a single, centralized server to store all files in the repository. - ANSWER-False The use of a git repository prevents merge conflicts. - ANSWER- False A git repository prevents the creation of branches by different coders on the same team. - ANSWER-False he SDD is a document intended for internal use by the team only - ANSWER-True Good practice dictates that once the architecture of a system is described in the SDD it cannot be changed. - ANSWER-False

The "Zune 30 Meltdown" occurred at the end of a leap year - ANSWERTrue The Phoenix Pay System fiasco has resulted in about 80 thousand federal government employees being underpaid, overpaid or not paid at all. - ANSWER-True The application of unit tests should be left to when there are enough files available to create an integrated system. - ANSWER- False Test driver code is used to represent code that the component being tested depends upon. - ANSWER-False Equivalence testing describes a technique used to design unit tests based on a thorough understanding of the structure of the code being tested. - ANSWER-False "Big Bang" integration testing does not require stub or driver code

ANSWER-True "Sandwich" integration testing does not require stub or driver code. - ANSWER-False

The "address of" operator, &, obtains a memory reference address in C++/CLI. - ANSWER-False he C standard library is included in the standard C++ library. - ANSWER-True A C++ program can contain and compile well-written C code. - ANSWER-True C++ programs are first compiled to intermediate "Ocode" files - ANSWER-True "O-code" files need to be processed to executable files before being sent to the OS for execution. - ANSWERTrue The GCC compiler (ported to MinGW) is the only C++ compiler that adheres to the ISO standards. - ANSWERFalse Atomic types (like int) cannot be initialized using ( ) as objects are.

ANSWER-False The long double type uses extended precision in C++. - ANSWER-True

By using pointer arithmetic it is possible to read memory locations that have not been assigned to variables. - ANSWER-True A C++ array will not allow you to supply index values that are out of range of the array. - ANSWER-False A struct can only contain members that are all of the same type. - ANSWER-False The operator, |, is the same as ||, except that it does not use short-circuit evaluation - ANSWER-False The assignment operator, =, returns the value being assigned. - ANSWER-True In a Boolean expression a non-zero integer will be considered as false. - ANSWER-False A pointer that has been assigned to nullptr will be evaluated as being true. - ANSWER-False he goto statement is legal syntax in C++. - ANSWERTrue A vector collection from the STL cannot use [ ] to access members. -

ANSWER-False The vector member function, .at(), can be used on the LHS of an assignment statement. - ANSWER- True The string member function, .at(), will throw an exception of an attempt is made to access a character beyond the size of the string. - ANSWERTrue The STL string class is immutable. - ANSWER-False Programs that have implementation code in the header, or *.h, file will not compile. - ANSWER-False If const is used at the end of a member function declaration then that function cannot change the values contained in the attributes of its own class. - ANSWERTrue The #pragma once pre-compiler directive can be used to prevent the redeclaration of a header file's contents. - ANSWER-True Only one class can be implemented at a time in a *.cpp file. - ANSWERFalse