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]
2 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]2 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
How the data is converted into the information?​
leonid [27]

Answer:

the data is converted into information by data processing

7 0
3 years ago
Read 2 more answers
When studying an information system, illustrations of actual documents should be collected using a process called _____.
Oliga [24]
<span>When studying an information system, illustrations of actual documents should be collected using a process called sampling. Correct answer: D
</span>This process systematically selects representative elements of a population with the goal to get representative and useful information about the population as a whole and it is useful when <span>data sets that are too large to efficiently analyze in full.</span>
6 0
3 years ago
Which is an example of a Boolean operator that evaluates as TRUE?
ladessa [460]

The expression NOT (3+2=7) evaluates as TRUE because is is NOT the case that 3+2=7.

Let me know if you have any questions.

4 0
2 years ago
Python;
riadik2000 [5.3K]

a = int(input("Class A tickets sold: "))

b = int(input("Class B tickets sold: "))

c = int(input("Class C tickets sold: "))

print("Total income generated: $"+str((a*20)+(b*15)+(c*10)))

I hope this helps!

4 0
2 years ago
Thabo has a small barber shop and he uses Microsoft applications to keep track of his stock and to create posters for advertisin
kirza4 [7]

An information system is crucial to the success of a business. Itemized below are five benefits of operating an information system in a business.

<h3>What are the benefits of an Information System?</h3>

Information systems are important because:

  1. They help to increase and enhance operational efficiencies such as accounting, sales, inventory, and HR operations.
  2. They help to minimize costs. As the business makes more and more informed decisions, its costs will drop.
  3. It enhances customer service. Information about customers helps the business to tailor its services to the requirements of each customer.
  4. Information system helps the decision-makers in the business to make better and more informed decisions.
  5. Information systems help to ensure business continuity.

<h3>What are the requirements for creating an information system?
</h3>

An information system requires the following:

  • Hardware for the computer workstation and addendums
  • Software
  • A network communication amongst the computers and hardware
  • a map of the company's processes and the people responsible for such processes
  • A procedural manual.
  • Existing data from the business.

For the barber's shop, for example, some of the components of the information system he must put in place are:

A workstation that collects information about:

  • Clients
  • Details of Sales
  • Expenses
  • Compliance dates and records etc.

Learn more about Information Systems at:

brainly.com/question/25226643

4 0
2 years ago
Other questions:
  • In order to paint a wall that has a number of windows, we want to know its area. Each window has a size of 2 ft by 3 ft. Write a
    12·2 answers
  • _____ software can help a company manage security, enforce corporate strategies, and control downloads and content streaming fro
    11·1 answer
  • What part of the boot-up process initializes hardware and finds an operating system to load?
    14·1 answer
  • Data flow is not a major consideration when building an analytics model. T/F
    13·1 answer
  • Expain the application areas of ICT in education sector and E-commerce​
    12·1 answer
  • What type of media is a hard disk​
    9·1 answer
  • How has music changed with the use of technology?
    14·1 answer
  • Select the correct answer.
    10·1 answer
  • when you sent email your email can be set to automatically keep a copy where do you find these copies​
    13·1 answer
  • How did Bill Gates benefit from free enterprise? Need a paragraph please. Will give the branliest!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!