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
grandymaker [24]
2 years ago
9

Write the definition of a void function that takes as input two integer values, say n and m. The function returns the sum and av

erage of all the numbers between n and m (inclusive).
Computers and Technology
1 answer:
hodyreva [135]2 years ago
7 0

Answer:

void mn(int m, int n){

   int sum = 0;

int count = 0;

   if(m<n){

       for(int i = m;i<=n;i++){

           sum+=i;

       }

   }

   else{

       for(int i = n;i<=m;i++){

           sum+=i;

       }

   }

count = abs(m - n)+1;

   cout<<"Sum: "<<sum<<endl;

   cout<<"Average: "<<(float)sum/count;

}

Explanation:

This line defines the method

void mn(int m, int n){

This initializes sum and count to 0

   int sum = 0;

int count = 0;

This checks if m is less than n

   if(m<n){

This iterates from m to n and calculates the sum of numbers between this interval

<em>   for(int i = m;i<=n;i++){</em>

<em>            sum+=i;</em>

<em>        }</em>

<em>    }</em>

If otherwise,

   else{

This iterates from n to m and calculates the sum of numbers between this interval

<em>        for(int i = n;i<=m;i++){</em>

<em>            sum+=i;</em>

<em>        }</em>

<em>    }</em>

This calculates the range from m to n using absolute function

count = abs(m - n)+1;

This prints the calculated sum

   cout<<"Sum: "<<sum<<endl;

This calculates and prints the average

   cout<<"Average: "<<(float)sum/count;

}

<em>See attachment for complete program that includes the main (in c++)</em>

Download cpp
You might be interested in
You have found statistics on the Internet that you would like to use in your speech.
miss Akunina [59]

Answer:

You cite them correctly and that the statistics are real.

Explanation:

5 0
3 years ago
Illia is a network administrator at a company.which tasks is she responsible for
irina1246 [14]

Answer: They organize, install, and support an organization's computer systems, including local area networks (LANs), wide area networks (WANs), network segments, intranets, and other data communication systems.

Explanation:

6 0
2 years ago
A computer supply company is located in a building with three wireless networks.
Sonja [21]

Answer:

A. Rogue access point

Explanation:

A rogue access point is defined as a wireless access point installed on a secure network infrastructure without consent of the owner of the network or without due authorization. While this can sometimes be added by a malicious attacker, it is most commonly set up by employees with the desire to have wireless access even when there is any available.

In the question, there are three wireless networks, but on scanning, five wireless networks were found, hence they are rogue access point.

3 0
3 years ago
What are some of the benefits of project
galina1969 [7]

Answer:

The project is more likely to be finished on  time.

Tasks can be done more efficiently.

Explanation:

Project management refers to the process involved in the management and accomplishment of the project. It includes the process, techniques, and guidance to carry on to complete a project. Project management helps in achieving the desired outcomes of the project. The efficient use of the resources and the proper management of the skills are ensured in project management. Better communication and an increase in satisfaction help in improving productivity.

4 0
3 years ago
Give five functions of Windows​
Nata [24]

Answer:

Explanation:

It knows how to remember data and where to find that data. In other words, it knows how the raw memory works. (RAM).

It understands how to make a program run within the confines of its logical steps in an order that makes the program work the way the user intends.

It can be made to display short cuts, or any icon or picture (not an obvious talent).

It can search for unwanted intruders like ads or viruses.

It can can time events even to the point of getting your coffee ready for you with the proper add on.

6 0
3 years ago
Other questions:
  • A patent facilitates a government-approved technological monopoly by
    5·1 answer
  • When you see ##### in a cell, you should A. increase the cell width. B. increase the cell height. C. decrease the cell width. D.
    14·1 answer
  • )in the link based implementation of the ADT sorted list what is the worst case time efficiency of the remove method?
    7·1 answer
  • Which key is used in word processors to create indentations?
    13·2 answers
  • A _____ are devices that permit a user to connect to a digital t-carrier service.
    6·1 answer
  • I'm stupid and Idk how to take a pic on a Chromebook so, I want to know how to take a pic on a cromebook.
    11·1 answer
  • I created a brainly account and forgot everything I mean everything so I cannot log back on and my debit Card is currently about
    11·2 answers
  • 50 ) What is the cell address of 4th row and 4th column? A) 4D B) E4 оооо C) 04 D) B4​
    9·1 answer
  • What is installing?
    6·2 answers
  • Write l for law of enrtia,ll for law of Acceleration and lll for law of enteraction.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!