SlideShare a Scribd company logo
GSP 125 Final Exam Guide
For more course tutorials visit
uophelp.com is now newtonhelp.com
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points :
3)
libraries.
math operations.
print statements.
variables.
Question 2. 2. Hiding data in a class is also called (Points : 3)
encapsulation.
accessibility inversion.
confusion culling.
redirection.
Question 3. 3. The public members of a class (Points : 3)
can be changed after compiling, even functions.
must be accessed from an object of that class.
need a special interface to accessed from an object.
can only be accessed within member functions of that class.
Question 4. 4. Constructors are called (Points : 3)
whenever an object is created.
whenever a new line of code is typed.
only after math operations.
only after a work contract is defined.
Question 5. 5. Unions are (Points : 3)
defined just like structs, though their memory behaves differently.
a place to store multiple data types simultaneously.
a concept from the C language that is uncommon in C++.
All of the above
Question 6. 6. When objects contain other objects, it is called (Points : 3)
composition.
data blending.
subobjecting.
enclosures.
Question 7. 7. Using the sizeof operator, the compiler will provide the size in bytes of
a (Points : 3)
class or data type.
statically allocated array.
variable instance or object.
All of the above
Question 8. 8. When de-allocating arrays dynamically allocated with new, _____
should be used to ensure proper de-allocation. (Points : 3)
destructor.
delete.
delete [].
free().
Question 9. 9. A pointer stores a(n) (Points : 3)
address.
variable.
value.
None of the above
Question 10. 10. The most common operator used when accessing members of an
object through a pointer is this. (Points : 3)
&
->
.
::
Question 11. 11. The following can be used to determine the number of elements in a
statically allocated array in C or C++. (Points : 3)
sizeof(arrayname)/sizeof(arrayname[0])
elementsof<arrayname>
arrayname.length()
None of the above
Question 12. 12. When returning by reference, (Points : 3)
the method can be used as an l-value.
other functions cannot use the result as a parameter.
C-style code must be capitalized, as per standard convention.
There is no such thing as returning by reference.
Question 13. 13. Overloaded methods in a class must use (Points : 3)
the exact same argument types, but different return types.
the exact same name.
default arguments.
None of the above
Question 14. 14. The copy constructor takes (Points : 3)
no arguments.
a single argument by reference.
a single argument by value.
any number of arguments.
Question 15. 15. A shallow copy is dangerous because (Points : 3)
it has a knife and is very clumsy.
it may cause bad de-allocation in a properly written destructor in a class that
allocates memory.
it prevents recursive methods from being called by using significant amounts of
stack space.
None of the above
Question 16. 16. When using inheritance, the class that is doing the inheriting is called
a (Points : 3)
subclass.
child class.
derived class.
All of the above
Question 17. 17. A UML class diagram is commonly used to (Points : 3)
exactly describe code before writing it.
help programmers explain design to other programmers.
define code standards (for syntax) for programming teams.
All of the above
Question 18. 18. Downcasting is considered safe because (Points : 3)
the compiler is very smart about types.
it is safe to assume a parent can do everything a child can do.
downcasting can only be done on upcasted objects.
downcasting is not considered safe.
Question 19. 19. If unsure whether to use inheritance or composition, use (Points : 3)
inheritance, because it saves the most typing.
inheritance, because C++ supports multiple inheritance.
composition, because it gives programmers the most options.
composition, because it is more efficient than inheritance.
Question 20. 20. Creating classes in separate .h and .cpp files is good because (Points :
3)
moving code to separate files is good design (separation of concerns).
separating declaration from definition allows decoupling of dependencies.
many smaller files are easier to maintain by teams of programmers.
All of the above
Question 21. 21. When using the virtual keyword, C++ can detect the type of an
object by using (Points : 3)
Compile Time Type Information.
dynamic_cast.
a "constructor inference" pattern.
C++ does not support any kind of reflection.
Question 22. 22. Passing pointers by reference (e.g., "(int * & arg)") is possible but
limited, because (Points : 3)
NULL cannot be passed as a valid pointer by reference.
a raw address (&variable) cannot be passed as a valid pointer by reference.
r-values cannot be passed as pointers by reference.
All of the above
Question 23. 23. Stack memory is where (Points : 3)
global variables and raw machine code are stored.
local variables and execution of instructions are kept track of.
dynamic memory is allocated to.
None of the above
Question 24. 24. A compiler will put sentinel values into memory to (Points : 3)
help detect array out-of-bound errors.
keep track of how many times a function recurses.
stop bad functions from being executed.
prevent memory leaks.
Question 25. 25. Virtual functions have a cost when compared to normal (statically
bound) functions; specifically, they are (Points : 3)
slower and less optimizable.
less dynamic.
unusable with polymorphism.
more difficult to read than extern or static functions.
Question 26. 26. In C++, the diamond problem that results from multiple inheritance
can be solved by (Points : 3)
extern inheritance.
static inheritance.
virtual inheritance.
inline inheritance.
Question 27. 27. Test-driven development is (Points : 3)
writing software after finishing multiple choice exams about software quality.
writing many small tests that initially fail, and working on each test until all
succeed.
another name for object-oriented programming.
All of the above
Question 28. 28. Which piece of the C/C++ compile tool chain arranges compiled
code into the final executable? (Points : 3)
Preprocessor
Compiler
Linker
Debugger
Question 29. 29. For C-style error codes to be used effectively, a programmer should
(Points : 3)
always do logic on function returns to test success.
check errno after potentially failed operations to see if any errors occurred.
read documentation to make sense of error codes.
All of the above
Question 30. 30. A class template allows (Points : 3)
a class to be re-defined with different types but the same code.
the compiler to ignore unused methods of the templated class.
the templated type to be any type, including another templated type.
All of the above
Question 31. 31. Write a “Hello World” program in C++. (Points : 2)
Question 32. 32. Write code for a struct called “Coin.” The Coin class should have a
floating-point member for radius and thickness and weight, a c-string member for
name, and an integer member for color. (Points : 7)
Question 33. 33. Write code for a class called "Double." The Double class should
have a single double member, value. Create accessors and mutators for value. The
default constructor of Double should set value to zero. (Points : 7)
Question 34. 34. Write a class named Person and create another class called Teacher,
which inherits from Person (Person is the parent class and Teacher is the child class).
(Points : 7)
Question 35. 35. Write code that instantiates an integer and prints out its address.
(Points : 7)
Question 36. 36. Write the body of thfollowing function so that it returns the square of
the number pointed at by the pointer argument.
float square(float * valuePtr)
{
} (Points : 7)
Question 37. 37. Consider the following class.
class ManagedArray {
public:
float * data;
int size;
ManagedArray():data(0),size(0){}
void setSize(int a_size){ size = a_size; data = new float[size]; }
};
Write a destructor for this class to de-allocate any memory it may have allocated.
(Points : 7)
Question 38. 38. Write code that dynamically allocates a two-dimensional array of
integers called map, 5 high, and 7 wide. Then, de-allocate the two-dimensional array.
(Points : 7)
Question 39. 39. Write code that allocates an integer on the stack and allocates another
integer array on the heap. (Points : 7)
Question 40.
40. Write an abstract base class called LivingThing that has the following methods:
breathe and eat. (Points : 7)
Related Tutorials

More Related Content

What's hot

Gsp 125 Enthusiastic Study / snaptutorial.com
Gsp 125 Enthusiastic Study / snaptutorial.comGsp 125 Enthusiastic Study / snaptutorial.com
Gsp 125 Enthusiastic Study / snaptutorial.com
Stephenson101
 
Gsp 125 Future Our Mission/newtonhelp.com
Gsp 125 Future Our Mission/newtonhelp.comGsp 125 Future Our Mission/newtonhelp.com
Gsp 125 Future Our Mission/newtonhelp.com
amaranthbeg8
 
GSP 125 RANK Education for Service--gsp125rank.com
GSP 125 RANK  Education for Service--gsp125rank.comGSP 125 RANK  Education for Service--gsp125rank.com
GSP 125 RANK Education for Service--gsp125rank.com
claric25
 
Uop gsp 125 final exam guide new
Uop gsp 125 final exam guide newUop gsp 125 final exam guide new
Uop gsp 125 final exam guide new
ElijahEthaan
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
shyamuopten
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparationKushaal Singla
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
chinthala Vijaya Kumar
 
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
chinthala Vijaya Kumar
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
Mahmoud Ouf
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii
kvs
 
Intake 38 4
Intake 38 4Intake 38 4
Intake 38 4
Mahmoud Ouf
 
Lesson 4 stacks and queues
Lesson 4  stacks and queuesLesson 4  stacks and queues
Lesson 4 stacks and queues
MLG College of Learning, Inc
 

What's hot (13)

Gsp 125 Enthusiastic Study / snaptutorial.com
Gsp 125 Enthusiastic Study / snaptutorial.comGsp 125 Enthusiastic Study / snaptutorial.com
Gsp 125 Enthusiastic Study / snaptutorial.com
 
Gsp 125 Future Our Mission/newtonhelp.com
Gsp 125 Future Our Mission/newtonhelp.comGsp 125 Future Our Mission/newtonhelp.com
Gsp 125 Future Our Mission/newtonhelp.com
 
GSP 125 RANK Education for Service--gsp125rank.com
GSP 125 RANK  Education for Service--gsp125rank.comGSP 125 RANK  Education for Service--gsp125rank.com
GSP 125 RANK Education for Service--gsp125rank.com
 
Uop gsp 125 final exam guide new
Uop gsp 125 final exam guide newUop gsp 125 final exam guide new
Uop gsp 125 final exam guide new
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 
C interview-questions-techpreparation
C interview-questions-techpreparationC interview-questions-techpreparation
C interview-questions-techpreparation
 
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
Computer Science(083) Python Pre Board Exam 1 Sample Paper Class 12
 
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
 
Java execise
Java execiseJava execise
Java execise
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Sample Question Paper IP Class xii
Sample Question Paper IP Class xii Sample Question Paper IP Class xii
Sample Question Paper IP Class xii
 
Intake 38 4
Intake 38 4Intake 38 4
Intake 38 4
 
Lesson 4 stacks and queues
Lesson 4  stacks and queuesLesson 4  stacks and queues
Lesson 4 stacks and queues
 

Similar to Gsp 125 final exam guide

Gsp 125 Massive Success / snaptutorial.com
Gsp 125  Massive Success / snaptutorial.comGsp 125  Massive Success / snaptutorial.com
Gsp 125 Massive Success / snaptutorial.com
NorrisMistryzo
 
GSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.comGSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.com
sholingarjosh136
 
GSP 125 Perfect Education/newtonhelp.com
GSP 125 Perfect Education/newtonhelp.comGSP 125 Perfect Education/newtonhelp.com
GSP 125 Perfect Education/newtonhelp.com
bellflower169
 
GSP 125 Become Exceptional/newtonhelp.com
GSP 125 Become Exceptional/newtonhelp.comGSP 125 Become Exceptional/newtonhelp.com
GSP 125 Become Exceptional/newtonhelp.com
bellflower148
 
GSP 125 Doing by learn/newtonhelp.com
GSP 125 Doing by learn/newtonhelp.comGSP 125 Doing by learn/newtonhelp.com
GSP 125 Doing by learn/newtonhelp.com
bellflower126
 
Exercise1[5points]Create the following classe
Exercise1[5points]Create the following classeExercise1[5points]Create the following classe
Exercise1[5points]Create the following classe
mecklenburgstrelitzh
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
soni_nits
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
ktuonlinenotes
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
krtioplal
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSSE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
nikshaikh786
 
Computer programming laboratory manual for b.tech
Computer programming laboratory manual for b.techComputer programming laboratory manual for b.tech
Computer programming laboratory manual for b.tech
hellogopinadh
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
rosemarybdodson23141
 
E1
E1E1
E1
lksoo
 
Oop july 2017
Oop july 2017Oop july 2017
Oop july 2017
ktuonlinenotes
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
Vectors Intro.ppt
Vectors Intro.pptVectors Intro.ppt
Vectors Intro.ppt
puneet680917
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
sheikhmoidin
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
lakshmi r
 
Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)
ktuonlinenotes
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
maxinesmith73660
 

Similar to Gsp 125 final exam guide (20)

Gsp 125 Massive Success / snaptutorial.com
Gsp 125  Massive Success / snaptutorial.comGsp 125  Massive Success / snaptutorial.com
Gsp 125 Massive Success / snaptutorial.com
 
GSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.comGSP 125 Technology levels--snaptutorial.com
GSP 125 Technology levels--snaptutorial.com
 
GSP 125 Perfect Education/newtonhelp.com
GSP 125 Perfect Education/newtonhelp.comGSP 125 Perfect Education/newtonhelp.com
GSP 125 Perfect Education/newtonhelp.com
 
GSP 125 Become Exceptional/newtonhelp.com
GSP 125 Become Exceptional/newtonhelp.comGSP 125 Become Exceptional/newtonhelp.com
GSP 125 Become Exceptional/newtonhelp.com
 
GSP 125 Doing by learn/newtonhelp.com
GSP 125 Doing by learn/newtonhelp.comGSP 125 Doing by learn/newtonhelp.com
GSP 125 Doing by learn/newtonhelp.com
 
Exercise1[5points]Create the following classe
Exercise1[5points]Create the following classeExercise1[5points]Create the following classe
Exercise1[5points]Create the following classe
 
17432 object oriented programming
17432   object oriented programming17432   object oriented programming
17432 object oriented programming
 
Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
SE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUSSE-IT JAVA LAB SYLLABUS
SE-IT JAVA LAB SYLLABUS
 
Computer programming laboratory manual for b.tech
Computer programming laboratory manual for b.techComputer programming laboratory manual for b.tech
Computer programming laboratory manual for b.tech
 
Name _______________________________ Class time __________.docx
Name _______________________________    Class time __________.docxName _______________________________    Class time __________.docx
Name _______________________________ Class time __________.docx
 
E1
E1E1
E1
 
Oop july 2017
Oop july 2017Oop july 2017
Oop july 2017
 
3rd Semester Computer Science and Engineering (ACU) Question papers
3rd Semester Computer Science and Engineering  (ACU) Question papers3rd Semester Computer Science and Engineering  (ACU) Question papers
3rd Semester Computer Science and Engineering (ACU) Question papers
 
Vectors Intro.ppt
Vectors Intro.pptVectors Intro.ppt
Vectors Intro.ppt
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 
Sp 1418794917
Sp 1418794917Sp 1418794917
Sp 1418794917
 
Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)Oop r&amp;s may 2019 (2)
Oop r&amp;s may 2019 (2)
 
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxConsider this code using the ArrayBag of Section 5.2 and the Locat.docx
Consider this code using the ArrayBag of Section 5.2 and the Locat.docx
 

Recently uploaded

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 

Recently uploaded (20)

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 

Gsp 125 final exam guide

  • 1. GSP 125 Final Exam Guide For more course tutorials visit uophelp.com is now newtonhelp.com www.newtonhelp.com Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3) libraries. math operations. print statements. variables. Question 2. 2. Hiding data in a class is also called (Points : 3) encapsulation. accessibility inversion. confusion culling. redirection. Question 3. 3. The public members of a class (Points : 3) can be changed after compiling, even functions. must be accessed from an object of that class. need a special interface to accessed from an object. can only be accessed within member functions of that class. Question 4. 4. Constructors are called (Points : 3)
  • 2. whenever an object is created. whenever a new line of code is typed. only after math operations. only after a work contract is defined. Question 5. 5. Unions are (Points : 3) defined just like structs, though their memory behaves differently. a place to store multiple data types simultaneously. a concept from the C language that is uncommon in C++. All of the above Question 6. 6. When objects contain other objects, it is called (Points : 3) composition. data blending. subobjecting. enclosures. Question 7. 7. Using the sizeof operator, the compiler will provide the size in bytes of a (Points : 3) class or data type. statically allocated array. variable instance or object. All of the above Question 8. 8. When de-allocating arrays dynamically allocated with new, _____ should be used to ensure proper de-allocation. (Points : 3)
  • 3. destructor. delete. delete []. free(). Question 9. 9. A pointer stores a(n) (Points : 3) address. variable. value. None of the above Question 10. 10. The most common operator used when accessing members of an object through a pointer is this. (Points : 3) & -> . :: Question 11. 11. The following can be used to determine the number of elements in a statically allocated array in C or C++. (Points : 3) sizeof(arrayname)/sizeof(arrayname[0]) elementsof<arrayname> arrayname.length() None of the above Question 12. 12. When returning by reference, (Points : 3)
  • 4. the method can be used as an l-value. other functions cannot use the result as a parameter. C-style code must be capitalized, as per standard convention. There is no such thing as returning by reference. Question 13. 13. Overloaded methods in a class must use (Points : 3) the exact same argument types, but different return types. the exact same name. default arguments. None of the above Question 14. 14. The copy constructor takes (Points : 3) no arguments. a single argument by reference. a single argument by value. any number of arguments. Question 15. 15. A shallow copy is dangerous because (Points : 3) it has a knife and is very clumsy. it may cause bad de-allocation in a properly written destructor in a class that allocates memory. it prevents recursive methods from being called by using significant amounts of stack space. None of the above Question 16. 16. When using inheritance, the class that is doing the inheriting is called a (Points : 3)
  • 5. subclass. child class. derived class. All of the above Question 17. 17. A UML class diagram is commonly used to (Points : 3) exactly describe code before writing it. help programmers explain design to other programmers. define code standards (for syntax) for programming teams. All of the above Question 18. 18. Downcasting is considered safe because (Points : 3) the compiler is very smart about types. it is safe to assume a parent can do everything a child can do. downcasting can only be done on upcasted objects. downcasting is not considered safe. Question 19. 19. If unsure whether to use inheritance or composition, use (Points : 3) inheritance, because it saves the most typing. inheritance, because C++ supports multiple inheritance. composition, because it gives programmers the most options. composition, because it is more efficient than inheritance. Question 20. 20. Creating classes in separate .h and .cpp files is good because (Points : 3) moving code to separate files is good design (separation of concerns).
  • 6. separating declaration from definition allows decoupling of dependencies. many smaller files are easier to maintain by teams of programmers. All of the above Question 21. 21. When using the virtual keyword, C++ can detect the type of an object by using (Points : 3) Compile Time Type Information. dynamic_cast. a "constructor inference" pattern. C++ does not support any kind of reflection. Question 22. 22. Passing pointers by reference (e.g., "(int * & arg)") is possible but limited, because (Points : 3) NULL cannot be passed as a valid pointer by reference. a raw address (&variable) cannot be passed as a valid pointer by reference. r-values cannot be passed as pointers by reference. All of the above Question 23. 23. Stack memory is where (Points : 3) global variables and raw machine code are stored. local variables and execution of instructions are kept track of. dynamic memory is allocated to. None of the above Question 24. 24. A compiler will put sentinel values into memory to (Points : 3) help detect array out-of-bound errors.
  • 7. keep track of how many times a function recurses. stop bad functions from being executed. prevent memory leaks. Question 25. 25. Virtual functions have a cost when compared to normal (statically bound) functions; specifically, they are (Points : 3) slower and less optimizable. less dynamic. unusable with polymorphism. more difficult to read than extern or static functions. Question 26. 26. In C++, the diamond problem that results from multiple inheritance can be solved by (Points : 3) extern inheritance. static inheritance. virtual inheritance. inline inheritance. Question 27. 27. Test-driven development is (Points : 3) writing software after finishing multiple choice exams about software quality. writing many small tests that initially fail, and working on each test until all succeed. another name for object-oriented programming. All of the above Question 28. 28. Which piece of the C/C++ compile tool chain arranges compiled code into the final executable? (Points : 3)
  • 8. Preprocessor Compiler Linker Debugger Question 29. 29. For C-style error codes to be used effectively, a programmer should (Points : 3) always do logic on function returns to test success. check errno after potentially failed operations to see if any errors occurred. read documentation to make sense of error codes. All of the above Question 30. 30. A class template allows (Points : 3) a class to be re-defined with different types but the same code. the compiler to ignore unused methods of the templated class. the templated type to be any type, including another templated type. All of the above Question 31. 31. Write a “Hello World” program in C++. (Points : 2) Question 32. 32. Write code for a struct called “Coin.” The Coin class should have a floating-point member for radius and thickness and weight, a c-string member for name, and an integer member for color. (Points : 7)
  • 9. Question 33. 33. Write code for a class called "Double." The Double class should have a single double member, value. Create accessors and mutators for value. The default constructor of Double should set value to zero. (Points : 7) Question 34. 34. Write a class named Person and create another class called Teacher, which inherits from Person (Person is the parent class and Teacher is the child class). (Points : 7) Question 35. 35. Write code that instantiates an integer and prints out its address. (Points : 7) Question 36. 36. Write the body of thfollowing function so that it returns the square of the number pointed at by the pointer argument. float square(float * valuePtr) { } (Points : 7)
  • 10. Question 37. 37. Consider the following class. class ManagedArray { public: float * data; int size; ManagedArray():data(0),size(0){} void setSize(int a_size){ size = a_size; data = new float[size]; } }; Write a destructor for this class to de-allocate any memory it may have allocated. (Points : 7) Question 38. 38. Write code that dynamically allocates a two-dimensional array of integers called map, 5 high, and 7 wide. Then, de-allocate the two-dimensional array. (Points : 7) Question 39. 39. Write code that allocates an integer on the stack and allocates another integer array on the heap. (Points : 7) Question 40. 40. Write an abstract base class called LivingThing that has the following methods: breathe and eat. (Points : 7)