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.
For more classes visit
www.snaptutorial.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
For more classes visit
www.snaptutorial.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
For more classes visit
www.snaptutorial.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.
For more course tutorials visit
www.tutorialrank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more course tutorials visit
www.tutorialrank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more classes visit
www.snaptutorial.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)
For more classes visit
www.snaptutorial.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
For more classes visit
www.snaptutorial.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
For more classes visit
www.snaptutorial.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.
For more course tutorials visit
www.tutorialrank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more course tutorials visit
www.tutorialrank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more classes visit
www.snaptutorial.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)
Gsp 125 Enthusiastic Study / snaptutorial.comStephenson101
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.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
GSP 125 RANK Education for Service--gsp125rank.comclaric25
FOR MORE CLASSES VISIT
www.gsp125rank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
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.
For more classes visit
www.snaptutorial.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.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
GSP 125 Become Exceptional/newtonhelp.combellflower148
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
Exercise
1
[5
points]:
Create the following classes shown in the UML diagram. Then, create PointTest.java class with main method to test all functionality of these classes.
Exercise
2
[10
points]:
The following figure shows a UML diagram in which the class Student is inherited from the class
Person
a. Implement a Person class. The person constructor takes two strings: a first name and a last name. The constructor initializes the email address to the first letter of the first name followed by first five letters of the last name followed by @tru.ca. If the last name has fewer than five letters, the e-mail address will be the first letter of the first name followed by the entire last name followed by a @tru.ca. Examples:
Name
Email Address
Jane Smith
[email protected]
Musfiq Rahman
[email protected]
John Morris
[email protected]
Mary Key
[email protected]
b. Override Object’s toString method for the Person class. The toString method should return the present state of the object.
c. Now, create a Student class that is a subclass of Person and implements Comparable interface.
d. The Student constructor will be called with two String parameters, the first name and last name of the student. When the student is constructed, the inherited fields lastName, firstName, and email will be properly initialized, the student’s gpa and number of credit will be set to 0. The variable lastIdAssigend will be properly incremented each time a Student object is constructed and the studentId will be set to the next available ID number as tracked by the class variable lastIdAssigend.
e. Override the object’s toString method for the Student class. The toString method should return the present state of the object.
Note that it should use the toString() method from its superclass.
f. The addCourse() method should update the credits completed, calculate, and update the gpa value.
Use the following values for grade:
Example GPA calculation:
GRADE CREDIT CALCULATION
(A) 4.0 x 4 = 16.00
(B) 3.0 x 4 = 12.00
(B) 3.0 x 4 = 12.00
(A) 4.0 x 1 = 4.00
(C) 2.0 x 3 = 6.00
GPA = 50.00 / 16 = 3.125; the getGPA() method should return this value.
g. Students are compared to each other by comparing GPAs. Override the compareTo() method for the student class. Note that to override the compareTo() method, the Student class must implement Comparable interface.
Now, test your code with the supplied client code (StudentClient.java). Note: You should not modify this client code. We will use the same client code to test your classes.
Exercise
3
[10
points]:
In this exercise, you need to implement a class that encapsulate a Grid. A grid is a useful concept in creating board-game applications. Later we will use this class to create a board game. A grid is a two-dimensional matrix (see example below) with the same number of rows and columns. You can create a grid o ...
Gsp 125 Enthusiastic Study / snaptutorial.comStephenson101
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.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
GSP 125 RANK Education for Service--gsp125rank.comclaric25
FOR MORE CLASSES VISIT
www.gsp125rank.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
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.
For more classes visit
www.snaptutorial.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.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
GSP 125 Become Exceptional/newtonhelp.combellflower148
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
For more course tutorials visit
www.newtonhelp.com
Question 1. 1. In addition to grouping functions together, a class also groups (Points : 3)
libraries.
math operations.
print statements.
variables.
Exercise
1
[5
points]:
Create the following classes shown in the UML diagram. Then, create PointTest.java class with main method to test all functionality of these classes.
Exercise
2
[10
points]:
The following figure shows a UML diagram in which the class Student is inherited from the class
Person
a. Implement a Person class. The person constructor takes two strings: a first name and a last name. The constructor initializes the email address to the first letter of the first name followed by first five letters of the last name followed by @tru.ca. If the last name has fewer than five letters, the e-mail address will be the first letter of the first name followed by the entire last name followed by a @tru.ca. Examples:
Name
Email Address
Jane Smith
[email protected]
Musfiq Rahman
[email protected]
John Morris
[email protected]
Mary Key
[email protected]
b. Override Object’s toString method for the Person class. The toString method should return the present state of the object.
c. Now, create a Student class that is a subclass of Person and implements Comparable interface.
d. The Student constructor will be called with two String parameters, the first name and last name of the student. When the student is constructed, the inherited fields lastName, firstName, and email will be properly initialized, the student’s gpa and number of credit will be set to 0. The variable lastIdAssigend will be properly incremented each time a Student object is constructed and the studentId will be set to the next available ID number as tracked by the class variable lastIdAssigend.
e. Override the object’s toString method for the Student class. The toString method should return the present state of the object.
Note that it should use the toString() method from its superclass.
f. The addCourse() method should update the credits completed, calculate, and update the gpa value.
Use the following values for grade:
Example GPA calculation:
GRADE CREDIT CALCULATION
(A) 4.0 x 4 = 16.00
(B) 3.0 x 4 = 12.00
(B) 3.0 x 4 = 12.00
(A) 4.0 x 1 = 4.00
(C) 2.0 x 3 = 6.00
GPA = 50.00 / 16 = 3.125; the getGPA() method should return this value.
g. Students are compared to each other by comparing GPAs. Override the compareTo() method for the student class. Note that to override the compareTo() method, the Student class must implement Comparable interface.
Now, test your code with the supplied client code (StudentClient.java). Note: You should not modify this client code. We will use the same client code to test your classes.
Exercise
3
[10
points]:
In this exercise, you need to implement a class that encapsulate a Grid. A grid is a useful concept in creating board-game applications. Later we will use this class to create a board game. A grid is a two-dimensional matrix (see example below) with the same number of rows and columns. You can create a grid o ...
Name _______________________________ Class time __________.docxrosemarybdodson23141
Name: _______________________________ Class time: __________
Prewriting Instructions for Paper 2 (Final Paper due 4/22)
1. Your choices for Paper 2 are posted on blackboard and also listed below.
2. Choose 1 of these paper options. Notice that each choice also mentions the type of paper (comparison, etc.) My paper choice is: _________________________: paper type: _______________.
3. Read the related essay(s) in your Research and Composition textbook.
4. Thursday: write a tentative thesis for paper 2 (one sentence): ______________________________________________________________________________________________________________________________________________________________________________________________________________________.
5. Thursday: write 5 questions that you will need to answer through research to write this paper (for ex. What is the divorce rate for 2012?) Write legibly please.
1.
2.
3.
4.
5.
6. Thursday: go to the library and use the databases to locate at least three sources that will likely give you the information to answer the five questions above. At least one should be a book, at least one should be a database article. In addition, you may use your textbook, internet, or even refer to a film. Write down the all of the information about each source. You will need this information for a works cited page later or to locate the article and book again. You do not need to answer the questions right away, but if you do find the answers, take notes or make a copy of the source.
Source 1: ____________________________________________________________________________________________________________________________________________________________
Source 2: ____________________________________________________________________________________________________________________________________________________________
Source 3: ____________________________________________________________________________________________________________________________________________________________
7. Have any new questions come to mind? What are they? Write them here:
8. Have you revised your thesis? What is it? ___________________________________
_____________________________________________________________________.
9. Write a tentative first paragraph to paper 2 (this includes your thesis):
10. Turn this in Tuesday 3/25 in exchange for your last Q exercise, M&M Color Distribution.
***You need this prewriting exercise completed to receive your instructions and data for this last Q exercise and parts of this exercise will count for your attendance in a week or so.
See next page
Writing Assignment 2 Choices due on or before 4/22
Here are your choices for Writing Assignment 2 due 4/22. Additional research is required for all choices. Two visuals, tables or figures, are required. Your paper will be in MLA format with a works cited page. This paper is approximately 5 pages including a works cited page.
1. Read the essays in Chapter 8. Go .
Unix and Shell Programming,
Q P Code: 60305.
Additional Mathematics I
Q P Code: 60306
Computer Organization and Architecture
Q P Code: 62303
Data Structures Using C
Q P Code: 60303
Discrete Mathematical Structures
Q P Code: 60304
Engineering Mathematics - III
Q P Code: 60301
Soft Skill Development
Q P Code: 60307
Vectors are the same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container. Vector elements are placed in contiguous storage so that they can be accessed and traversed using iterators. In vectors, data is inserted at the end. Inserting at the end takes differential time, as sometimes the array may need to be extended. Removing the last element takes only constant time because no resizing happens. Inserting and erasing at the beginning or in the middle is linear in time.
What is std::vector in C++?
std::vector in C++ is the class template that contains the vector container and its member functions. It is defined inside the <vector> header file. The member functions of std::vector class provide various functionalities to vector containers. Some commonly used member functions are written below:
Iterators
begin() – Returns an iterator pointing to the first element in the vector
end() – Returns an iterator pointing to the theoretical element that follows the last element in the vector
rbegin() – Returns a reverse iterator pointing to the last element in the vector (reverse beginning). It moves from last to first element
rend() – Returns a reverse iterator pointing to the theoretical element preceding the first element in the vector (considered as reverse end)
cbegin() – Returns a constant iterator pointing to the first element in the vector.
cend() – Returns a constant iterator pointing to the theoretical element that follows the last element in the vector.
crbegin() – Returns a constant reverse iterator pointing to the last element in the vector (reverse beginning). It moves from last to first element
crend() – Returns a constant reverse iterator pointing to the theoretical element preceding the first element in the vector (considered as reverse end)
Capacity
size() – Returns the number of elements in the vector.
max_size() – Returns the maximum number of elements that the vector can hold.
capacity() – Returns the size of the storage space currently allocated to the vector expressed as number of elements.
resize(n) – Resizes the container so that it contains ‘n’ elements.
empty() – Returns whether the container is empty.
shrink_to_fit() – Reduces the capacity of the container to fit its size and destroys all elements beyond the capacity.
reserve() – Requests that the vector capacity be at least enough to contain n elements.
Element access
reference operator [g] – Returns a reference to the element at position ‘g’ in the vector
at(g) – Returns a reference to the element at position ‘g’ in the vector
front() – Returns a reference to the first element in the vector
back() – Returns a reference to the last element in the vector
data() – Returns a direct pointer to the memory array used internally by the vector to store its owned elements.
Modifiers
assign() – It assigns new value to the vector elements by replacing old ones
Consider this code using the ArrayBag of Section 5.2 and the Locat.docxmaxinesmith73660
Consider this code using the ArrayBag of Section 5.2 and the Location class from Chapter 2. What is the output?
Location i = new Location(0, 3);
Location j = new Location(0, 3);
b.add(i);
b.add(j);
System.out.println(b.countOccurrences(i));
A. 0
B. 1
C. 2
D. 3
Suppose that b and c are Integer objects. A typical use of the clone method looks like this:
b = (Integer) c.clone( );
Write a short clear explanation of why the (Integer) type cast is required in this typical example.
A. obj = s;
B. s = obj;
C. s = (String) obj;
D. Two or more answers are correct.
Suppose that obj is an Object variable and s is a String variable. Which of the following statements
is a correctly-compiling widening conversion? Don't worry about possible run-time exceptions
A. obj = s;
B. s = obj;
C. s = (String) obj;
D. Two or more answers are correct.
Suppose that x and y are reference variables and a program activates x.equals(y). What occurs if x is the null reference?
A. A NullPointerException occurs
B. It always returns true.
C. It always returns false.
D. It returns true if y is also a null reference; otherwise it returns false.
Consider the implementation of the Stack using a partially-filled array.
What goes wrong if we try to store the top of the Stack at location [0] and the bottom of the Stack at the last used position of the array?
A. Both peek and pop would require linear time.
B. Both push and pop would require linear time.
C. The Stack could not be used to check balanced parentheses.
D. The Stack could not be used to evaluate postfix expressions.
Write some lines of code that declares an Integer object, using the Integer wrapper class.
Assign the value 42 to this object, then copy this value from the Integer object to an ordinary int variable.
Consider the usual algorithm for determining whether a sequence of parentheses is balanced.
What is the maximum number of parentheses that will appear on the stack AT ANY ONE TIME when the algorithm analyzes: (()(())(()))?
A. 1
B. 2
C. 3
D. 4
E. 5 or more
Consider the usual algorithm to convert an infix expression to a postfix expression.
Suppose that you have read 10 input characters during a conversion and that the
stack now contains the symbols as shown below. Suppose that you read and process
the 11th symbol of the input. What symbol is at the top of the stack in the case where
the 11th symbol is each of the choices shown?
Which of the following stack operations could result in stack underflow?
Answer
A. is_empty
B. pop
C. push
D. Two or more of the above answers
What is the value of the postfix expression 6 3 2 4 + - *:
Answer
A. Something between -15 and -100
B. Something between -5 and -15
C. Something between 5 and -5
D. Something between 5 and 15
E. Something between 15 and 100
1. An array o.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
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)