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
A device that filters data traffic at a network boundary​
Semmy [17]

Answer:

Bridges

Explanation:

A bridge is a transition effects that separates network traffic at the network's edge. By splitting a local area network into two parts, bridges minimise the number of bandwidth.

6 0
2 years ago
Truck drivers probably can't see your vehicle if ______________.
Arada [10]
<h2>Answer:</h2>

Truck drivers probably can't see your vehicle if you cannot see them in their side mirror

<h2>Explanation:</h2>

In driving terminology there is a term called the bind spot. Blind spot is the area where the driver is not able to see the vehicle behind him and this area is present just behind the truck and very close to the gates of the car. Since trucks do not have the rare mirror therefore if a car is present in their blind spot they wont be able to see it. The driver behind the truck can spot it if he does not see the truck driver in the side mirror of the truck.

5 0
3 years ago
Read 2 more answers
Lots of Ways to Use Math.random() in JavaScript
Alja [10]

Math.random() is a built-in function in JavaScript that generates a random number between 0 and 1.

<h3>What is Math.random()?</h3>

Math.random() is a useful and versatile function that can add a element of randomness to your JavaScript programs.

This function can be used in a variety of ways in JavaScript programs, such as:

  1. Generating random numbers for games or simulations.
  2. Creating random samples for statistical analysis.
  3. Shuffling elements in an array for a random order.
  4. Selecting random items from a list for a quiz or survey.
  5. Creating unique IDs or keys for objects in a database.

To Know More About built-in function, Check Out

brainly.com/question/29796505

#SPJ4

8 0
1 year ago
You use the Paste Options button labeled ____ if you want the pasted chart not to be linked to the source document and you want
Semenov [28]

Answer:

Keep Source Formatting & Embed Workbook

Explanation:

Source formatting is used to apply the formatting from source document while copying and pasting.

Source is the place where the data is already placed and we want to move it make a copy of it on some other document. So if we don't want to change the formatting of source document, we choose source formatting from the options while pasting.

Embed is used to whenever we don't want to link the formatting with source document.

So,

You use the Paste Options button labeled <u><em>Keep Source Formatting & Embed Workbook</em></u><em> </em>if you want the pasted chart not to be linked to the source document and you want the pasted chart to keep the formatting from the source document.

8 0
2 years ago
Read 2 more answers
A computer ____ is a potentially damaging computer program that affects a computer negatively by altering the way the computer w
Leviafan [203]
Virus










-----------------------------------
5 0
3 years ago
Other questions:
  • What environmental concern will hybrid cars address?
    6·2 answers
  • Write a class called (d) Teacher that has just a main method. The main method should construct a GradeBook for a class with two
    7·1 answer
  • What does it mean to be self demanding?
    12·1 answer
  • Bayley wants to connect a new external hard drive to his Windows PC. He wants the fastest connection type available because he p
    9·2 answers
  • Write a function process_spec that takes a dictionary (cmap), a list (spec) and a Boolean variable (Button A) as arguments and r
    10·1 answer
  • Sue follows these steps to create a chart in her presentation.
    13·1 answer
  • Plssssssssssssss help quick
    8·1 answer
  • What feature should be used before a document is printed
    8·1 answer
  • What are other ways you could use the shake or compass code blocks in physical computing projects?
    14·1 answer
  • 3. Special keys labelled Fl to F12.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!