answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lunna [17]
2 years ago
4

Define the missing member function. Use "this" to distinguish the local member from the parameter name.

Computers and Technology
2 answers:
murzikaleks [220]2 years ago
5 0

Answer:

Here is the complete member function:

void CablePlan::SetNumDays(int numDays) {   //member function of class CablePlan which take numDays as parameter

this->numDays = numDays;   // refers to the fields numDays of CablePlan  class using this keyword

return;  }

Explanation:

The complete program is:  

#include <iostream>  //to use input output functions

using namespace std; //to identify objects like cin cout

class CablePlan{  //class

public:  //public methods of class

void SetNumDays(int numDays); //method of class CablePlan that takes numDays as parameter to set the days

int GetNumDays() const;  // method of class CablePlan to get no of days

private:  //private data member of class CablePlan

int numDays;  //private data member of class CablePlan that holds no of days

};

// FIXME: Define SetNumDays() member function, using "this" implicit parameter.

void CablePlan::SetNumDays(int numDays) { /

this->numDays = numDays;     // used to refer to numDays variable of CablePlan class using this keyword

return;}  

int CablePlan::GetNumDays() const {  //define member function GetNumDays

return numDays;}  

int main() {  //start of main function

CablePlan house1Plan;  //creates object of CablePlan class

house1Plan.SetNumDays(30);  //uses object to call member function of  CablePlan passing value 30 to it in order to set no of days

cout << house1Plan.GetNumDays() << endl;  //uses object to call member function of  CablePlan to get the no of days (numDays)

return 0;}

Here this keyword is used to refer to the field i.e. numDays of CablePlan class. This distinguishes local member numDays  from parameter numDays using this with -> symbol.  

'this' pointer retrieves the object's numDays  which is hidden by the local variable numDays . The output of this program is:

30

egoroff_w [7]2 years ago
5 0

Answer:

this.numDays = numDays;

Explanation:

You just need one line of code.  "this." to access the class member, and the "." is the member access operator.

You might be interested in
All of the following are specific security challenges that threaten corporate systems in a client/server environment except:
Fudgin [204]

Answer:

Option D i.e., radiation is the correct answer.

Explanation:

When any person challenges the specific security system for the purpose of stealing the resources from the corporate security system then they unable to threaten the radiation because it is the electromagnetic waves that affect the body or skin of any human being and it can be generated by those devices that have high-voltage.

8 0
2 years ago
A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
muminat

The code below is used to determine a recursive, bool-valued function, isPalindrome, that accepts an integer-valued array, and the number of elements and returns whether the array is a palindrome.

Explanation:

  • The code shows 'array palindrome' is an array which, when its elements are reversed, remains the same.

bool isPalindrome(arr[((n-1) - n) +1], n)

{

   if (n == 0 || n == 1)

   {

       return true;

   }

   else if (arr[n-1] == isPalindrome(arr[], n-1)

   {

       return true;

   }  

   else {

       return false;

   }

}

5 0
2 years ago
_____________ helps to control and limit the number of consecutive request failures that cross a threshold. Review breaker Micro
True [87]

Answer:

Circuit breaker

Explanation:

Circuit breaker -

It is a type of electrical switch , whose main function is to protect the electrical circuit by the process of short circuit or overloading , is referred to as a circuit breaker .

The circuit breaker , as the name suggests , disrupts the circuit as soon as there is the condition of overloading or short circuit , and thereby saves the appliances .

Hence , from the given information of the question,

The correct term is circuit breaker  .

5 0
2 years ago
What are some ways to accomplish full-duplex (FDX) digital communications on guided medium at the physical layer (OSI Layer 1)?
labwork [276]

Answer:

d. All of the above

Explanation:

Physical layer is the lowest layer of the OSI reference model that deals with the setup of physical connection to the network and with transmission and reception of signals.

Full duplex (FDx) is a bidirectional type of communication system where two end nodes send and receive data signals at the same time, and a single carrier is simultaneously used for dual communication.

To send or receive data, the participating nodes in a Full Duplex system do not have to wait for a free carrier/medium. It employs a medium that has at least two internal channels - one for sending and one for receiving.

Based on the above explanations, options A, B and C are valid and are correct ways to accomplish full-duplex (FDX) digital communications on guided medium at the physical layer (OSI Layer 1). There all of them are correct.

6 0
2 years ago
7.8.1: Function pass by reference: Transforming coordinates. Define a function CoordTransform() that transforms the function's f
Lilit [14]

Answer:

Here is the CoordTransform() function:              

void CoordTransform(int xVal, int yVal, int &xValNew, int &yValNew){

xValNew = (xVal + 1) * 2;

yValNew = (yVal + 1) * 2; }

The above method has four parameters xVal  and yVal that are used as input parameters and xValNew yValNew as output parameters. This function returns void and transforms its first two input parameters xVal and yVal into two output parameters xValNew and yValNew according to the formula: new = (old + 1) *

Here new variables are xValNew  and yValNew and old is represented by xVal and yVal.

Here the variables xValNew and yValNew are passed by reference which means any change made to these variables will be reflected in main(). Whereas variables xVal and yVal are passed by value.

Explanation:

Here is the complete program:

#include <iostream>

using namespace std;

void CoordTransform(int xVal, int yVal, int &xValNew, int &yValNew){

xValNew = (xVal + 1) * 2;

yValNew = (yVal + 1) * 2;}

int main()

{ int xValNew;

int yValNew;

int xValUser;

int yValUser;

cin >> xValUser;

cin >> yValUser;

CoordTransform(xValUser, yValUser, xValNew, yValNew);

cout << "(" << xValUser << ", " << yValUser << ") becomes (" << xValNew << ", " << yValNew << ")" << endl;

return 0; }

The output is given in the attached screenshot   

7 0
2 years ago
Other questions:
  • A(n) ____ is an electronic device, operating under the control of instructions stored in its own memory, that can accept data, p
    14·1 answer
  • Python comes with ________ functions that have been already prewritten for the programmer.
    5·1 answer
  • Isabel is creating a wireframe. She has drawn a layout for the home page along with outlining the navigation elements. She now w
    15·2 answers
  • Suppose a retailer who has no technology expertise wishes to set up an online presence for his business. He ________. a. ​can us
    6·1 answer
  • The effectiveness of a(n) _____ process is essential to ensure the success of a data warehouse. Select one: a. visual basic b. e
    15·2 answers
  • 63:47 One side in a Transmission Control Protocol (TCP) connection has not been able to properly recover from a series of malfor
    15·1 answer
  • In this assignment, you are provided with working code that does the following: 1. You input a sentence (containing no more than
    14·1 answer
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    6·1 answer
  • Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that
    6·1 answer
  • A company has deployed four 48-port access layer switches to a switch block. For redundancy each access layer switch will connec
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!