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
juin [17]
2 years ago
5

You are training to complete in a local 5K run. You record your time scores in minutes after completing seven practice runs. Wri

te a method to calculate and return the average score based on the data.
Computers and Technology
1 answer:
trapecia [35]2 years ago
3 0

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

float Avg(float sum, int n)//defining method Avg that accepts float parameter

{

float average=sum/n;//defining float variable average that holds average value  

return average;//return average

}

int main()//defining main method

{

float ar[ ] = {24.1,24.5,24.4,23.8,28.2,29.1,27.4};//defining float array

float sum;//defining float variable sum

int n=7,i;//defining integer variable  

for (i = 0; i <n; i++)//defining loop to count total of array

{

sum=sum+ar[i];//add value in sum variable

}

cout<<"The average is: "<<Avg(sum,n);//use print method to call and print method return value

return 0;

}

Output:

The average is: 25.9286

Explanation:

In the above code, the float method "Avg" is declared, that accepts two parameters, that is "sum and n", inside the method, a float variable average is declared that divides and returns its values.

In the main method a float array "ar" is declared that holds values, in the next line, float variable "sum" and integer variable "n, j" is used.

In for loop, the "i" variable is used to add array values in the sum variable and pass into cout to call the "Avg" method and print its return value.

You might be interested in
Which of the following documents cannot be created using the Microsoft® Word® application?
denis23 [38]
The correct answer is C. Customer spreadsheet
7 0
3 years ago
Read 2 more answers
Microsoft acknowledged that if you type a res:// url (a microsoft-devised type of url) which is longer than ____ characters in i
cluponka [151]
Which is longer than 20 characters
5 0
3 years ago
What is a program file​
Fantom [35]

Answer:

Program Files is the directory name of a standard folder in Microsoft Windows operating systems in which applications that are not part of the operating system are conventionally installed.

Explanation:

7 0
2 years ago
Frances is rearranging her furniture. (1) Also, she is moving the heavy oak bookcase to the back bedroom. (2) She has decided to
lozanna [386]

The first sentence that seems out of the logical order is the very first sentence, i.e, Also, she is moving the heavy oak bookcase to the bedroom.

A.  1

<u>Explanation:</u>

The fact that the sentence uses words like "she" and "also" leads to this conclusion. The logical order should move in a forward direction with the sentences forming a logical sequence.

The first sentence's structure is adding details to the actions which are already in progress and hence it should not be the first sentence. It should appear after the process of moving furniture has been started and further details are being added to it.

3 0
2 years ago
Read 2 more answers
Surprisingly, many of us may be unknowing victims of botnets. Because of the rising sophistication of botnet schemes, your compu
Virty [35]

Answer:

a. Simple rules

1. Upgrade your operating system

2. Upgrade your softwares regularly

3. Upgrade your browser when new additions are available

4. Change your password very often

b. Suspensious signs

1. The operating system and programs take a longer while to start up.

2. It shows lack of storage space despite having space

3. The PC crashes regularly

4. If the sent mails are received as spam

5. The hard disk is working excessively while no programs are currently running

C. All the part of a security incident should be logged.

Explanation:

a. Simple rules

1. Upgrade your operating system

2. Upgrade your softwares regularly

3. Upgrade your browser when new additions are available

4. Change your password very often

b. Suspensious signs

1. The operating system and programs take a longer while to start up.

2. It shows lack of storage space despite having space

3. The PC crashes regularly

4. If the sent mails are received as spam

5. The hard disk is working excessively while no programs are currently running

Explanation:

C. All the part of a security incident should be logged.

7 0
2 years ago
Other questions:
  • Which is the most efficient way to italicize a row of text in every worksheet in a workbook?
    8·1 answer
  • Mrs. Golden wanted to collect baseline data on how often Lauren speaks to her neighbors during silent reading. He divided the 15
    9·1 answer
  • The measure of the maximum amount of data that can travel through a computer’s communications path in a given amount of time is
    9·1 answer
  • Wap-enabled devices require a ________, a special web browser that has all the features of computer-based browsers but is simpli
    11·1 answer
  • A and B have same output or not? A B x=0 x=0 do do x&lt;3 x=x+1 x=x+1 print x print x while x&lt;3 while
    13·1 answer
  • What is the name of the program file that you can enter in the Windows search or Run box to execute Event Viewer? What process i
    12·1 answer
  • 1.Terry turned on his computer one day to find that all of the storage on his computer was filled up. Furthermore, there were ma
    6·1 answer
  • Define the following term. data, database, DBMS, database system, data- base catalog, program-data independence, user wen', DBA,
    12·1 answer
  • What are the different alignment options available in Microsoft​
    11·2 answers
  • What is the difference between a general ai as opposed to a specialized ai?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!