1answer.
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
Airida [17]
3 years ago
14

Write two alternate functions specified below, each of which simply triples the variable count defined in main. These two functi

ons are: a. Function tripleByValue that passes a copy of count by value, triples the copy and returns the new value.b. Function tripleByReference that passes count by reference via a reference parameter and triples the original value of count through its alias(i.e. the reference parameter)For example, if count
Computers and Technology
1 answer:
Vedmedyk [2.9K]3 years ago
7 0

Answer:

Following are the code to this question:

#include <iostream>//header file

using namespace std;

int triplebyValue(int count)//defining a method triplebyValue

{

int x=count*3;//defining a variable x that multiply by 3 in the count  

return x;//return value of x

}

void triplebyReference(int& count)//defining a method triplebyReference that hold count variable as a reference in parameter

{

count*=3;//multipling a value 3 in the count variable

}

int main()//main method

{

int count;//defining integer variable

count=triplebyValue(3);//use count to call triplebyValue method

cout<<"After call by value, count= "<<count<<endl;//print count value with message

triplebyReference(count);//calling a method triplebyReference

cout<<"After call by reference, count= "<<count<<endl;//print count value with message

return 0;

}

Output:

After call by value, count= 9

After call by reference, count= 27

Explanation:

In this code two methods "triplebyValue and triplebyReference" are declared, which accepts a count variable as a parameter, and in both multiply the count value by 3 and return its value.

Inside the main method, an integer variable "count" is declared that first calls the "triplebyValue" method and holds its value into count variable and in the next, the method value is a pass in another method that is "triplebyReference", and use print method to print both methods value with a message.

You might be interested in
Rachel is a junior system administrator for a network with a single Active Directory domain. The network has just expanded to in
Pepsi [2]

Answer: Ask a member of the Enterprise Admins group to authorize the server.

Explanation:

From the information given, we are informed that Rachel installed a new server running Windows Server 2016 on the new subnet and configure it as a DHCP server but then realizes that the DHCP server service has started, but that the server does not respond to DHCP lease requests.

In this case, the reason for this can be attributed to the fact that the server hasn't been authorized, therefore, she can ask a member of the Enterprise Admins group to authorize the server.

4 0
3 years ago
You're the administrator for a large bottling company. At the end of each month, you routinely view all logs and look for discre
Natali [406]

Answer:

It seems as though it would be a DDoS attack.

Explanation:

The characteristics are as follows:

A slow down of operations and attempting to get access into said service.

4 0
3 years ago
___________ is a task pane used to correct grammar errors; opens when you click the Spelling &amp; Grammar button in the Proofin
BaLLatris [955]

Answer:

Spelling Task Pane

Explanation:

According to my research on Microsoft Office Studio, I can say that based on the information provided within the question the feature being mentioned in the question is called the Spelling Task Pane. By selecting this pane word will offer various grammar and spelling assistance, such as correcting words and offering one or more suggestions.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
Read 2 more answers
1. What is an advantage of the PCIe bus over the PCI bus?
m_a_m_a [10]

Answer:

Explanation:

1. PCI Express (PCIe) is a next generation I/O bus architecture. Rather than a shared bus, each PCIe slot links to a switch which prioritizes and routes data through a point-to-point dedicated connection and provides a serial full-duplex method of transmission.

2. Mini-ITX or Laptops

3.PCMCIA Personal Computer Memory Card International Association

4. PCIe x1 slot

8 0
4 years ago
Which of the following is an example of a federal tax? A. Social Security tax B. Sales tax C. Property tax D. Transaction tax
Nastasia [14]
Property tax should be the correct answer
6 0
3 years ago
Other questions:
  • Bryan knows that it takes him fifteen minutes to drive to work, or twenty minutes if every traffic light is red on the way there
    14·2 answers
  • Discuss how advertising on the Web affects search results and the ethical dilemmas associated with it.
    5·1 answer
  • Professional photography is a competitive job field. <br> true <br> false
    12·2 answers
  • Where would you look to see how much space is available on your c drive?
    8·1 answer
  • Other side for bullying
    7·1 answer
  • Sam would like to install a new application on every computer in his SOHO network. All the computers are currently connected in
    15·1 answer
  • Anyone follows abhay​
    10·1 answer
  • Matching parentheses. An math expression may have a number of parentheses like (, ), [, ], { and }. Each openning parenthesis (,
    5·1 answer
  • A user can add color to a database to highlight a modification. To do this with a macro, which command screen would you access o
    9·1 answer
  • if a college wanted to provide its students with access to a network that could be used in any of the buildings across campus, i
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!