Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3.1 Suppose a project contains two functions with the same name, e.g., void foo(

ID: 3532684 • Letter: 3

Question

3.1
Suppose a project contains two functions with the same name, e.g., void foo(int a, int b) { ... } int foo(double x, double y) { ... } In this case, function foo() is said to be ___. Explain how the compiler knows which function to call when we write foo(10, 20); and foo(1.2, 3.4); 3.2
Write a void function named GetXYZ () which has three formal parameters x, y, and z all integers. The function displays a prompt to ask the user to enter a value for x and then reads a value from the keyboard into x. It repeats this for parameters yand z. The values read into x, y, and z are output parameters to be sent back to the function that called GetXYZ ().
4.1 An object has two types of members: ___ members and ___ members. The formal definition of an object is that it is a(n) ___ of a class. 4.2 A public function of an object may be called by the functions of other objects: true or false? A private function of an object may be called by the functions of other objects: true or false? 4.3 A function that provides "read" access to a data member is a(n) ___ function. A function that provides "write" access to a data member is a(n) ___ function. 4.4 If Point is a class and we write Point p1; to define a Point object named p1, then at runtime p1 is ___ (hint: the word starts with an i and means the same thing as created). Next, the ___ ___ (two words) is called to initialize the object. 4.5 Explain why objects are generally passed by-reference.
4.7 Write the function definition for the constructor which will initialize the mCenter and mRadius data members with the formal parameters.
4.8 Write the function definition for GetRadius(). 4.9 Write the function definition SetPoint(). 3.1
Suppose a project contains two functions with the same name, e.g., void foo(int a, int b) { ... } int foo(double x, double y) { ... } In this case, function foo() is said to be ___. Explain how the compiler knows which function to call when we write foo(10, 20); and foo(1.2, 3.4); 3.2
Write a void function named GetXYZ () which has three formal parameters x, y, and z all integers. The function displays a prompt to ask the user to enter a value for x and then reads a value from the keyboard into x. It repeats this for parameters yand z. The values read into x, y, and z are output parameters to be sent back to the function that called GetXYZ ().
4.1 An object has two types of members: ___ members and ___ members. The formal definition of an object is that it is a(n) ___ of a class. 4.2 A public function of an object may be called by the functions of other objects: true or false? A private function of an object may be called by the functions of other objects: true or false? 4.3 A function that provides "read" access to a data member is a(n) ___ function. A function that provides "write" access to a data member is a(n) ___ function. 4.4 If Point is a class and we write Point p1; to define a Point object named p1, then at runtime p1 is ___ (hint: the word starts with an i and means the same thing as created). Next, the ___ ___ (two words) is called to initialize the object. 4.5 Explain why objects are generally passed by-reference.
4.7 Write the function definition for the constructor which will initialize the mCenter and mRadius data members with the formal parameters.
4.8 Write the function definition for GetRadius(). 4.9 Write the function definition SetPoint(). 4.1 An object has two types of members: ___ members and ___ members. The formal definition of an object is that it is a(n) ___ of a class. 4.2 A public function of an object may be called by the functions of other objects: true or false? A private function of an object may be called by the functions of other objects: true or false? 4.3 A function that provides "read" access to a data member is a(n) ___ function. A function that provides "write" access to a data member is a(n) ___ function. 4.4 If Point is a class and we write Point p1; to define a Point object named p1, then at runtime p1 is ___ (hint: the word starts with an i and means the same thing as created). Next, the ___ ___ (two words) is called to initialize the object. 4.5 Explain why objects are generally passed by-reference.
4.7 Write the function definition for the constructor which will initialize the mCenter and mRadius data members with the formal parameters.
4.8 Write the function definition for GetRadius(). 4.9 Write the function definition SetPoint(). 4.7 Write the function definition for the constructor which will initialize the mCenter and mRadius data members with the formal parameters.
4.8 Write the function definition for GetRadius(). 4.9 Write the function definition SetPoint(). 4.8 Write the function definition for GetRadius(). 4.9 Write the function definition SetPoint().

Explanation / Answer

3.1)function overload

3.2) public void GETXYZ()

{

cin<<x;

cin<<y;

cin<<z;

}

4.1public and private

instantiation of object

4.2 True

False

4.3 accessor

setter

4.4 null

new Point()

4.5 so that the values at their memory location can be changed

4.6,4.7,4.8 combined

class mcircle

{

int mcentre;

int mradius;

public mcircle()

{

mcentre=0;

mradius=0;

}

public mcircle(int a,int b)

{

mcentre=a;

mradius=b;

}

public int GetRadius()

{

return mradius;

}

public void SetPoint(int b)

{

mcentre=b;

}

}

Plz rate me 5 stars

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote