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]
3 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]3 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
What folder holds 32-bit programs installed in a 64-bit installation of windows?
raketka [301]
<span>C:\Program Files (x86) folder</span>
8 0
3 years ago
Manufacturing changes what materials into useful products
Vlad [161]

Answer:

Raw Materials

Explanation:

Raw materials are the resources used by a company to produce its finished goods and products. some common raw materials are cocoa for beverages, limestone for cement etc

3 0
3 years ago
Explain vividly any operating system of your choice stating at least 3 distinguishing features of each version.
rosijanka [135]

Answer:

microsoft windows, macOS, and linux

Explanation:

if you need help let me know

7 0
3 years ago
Read 2 more answers
1) a program that is designed to perform only one task.
JulijaS [17]

Answer:

special purpose application software

Explanation:

it is a type of software created to execute one specific task.for example a camera application on your phone wul only allow you to take and share pictures.

Other example of special purpose application are web browsers,calculators,media playors,calendar programs e.t.c.

7 0
3 years ago
Alcohol is considered a _____ drug
andreyandreev [35.5K]
Bad.......................
8 0
4 years ago
Read 2 more answers
Other questions:
  • Which type of topology describes the physical arrangement, installation, and connection of cables, computer, and other devices?
    10·2 answers
  • The combination of two or more technologies or data feeds into a single, integrated tool is referred to as a _____.
    7·1 answer
  • What does a data bar in a cell represents​
    12·2 answers
  • What is the purpose of the .NET Framework Class Library? a. it provides pre-written code that can be used by .NET applications b
    13·1 answer
  • For this project you will write a Java program that will run a simple math quiz. Your program will generate two random integers
    15·1 answer
  • Find the area of square whose perimeter is 260.8m​
    12·1 answer
  • Marla wants to transfer photos from her digital camera to her computer. She has plugged the camera's cord into the USB port. Wha
    11·2 answers
  • When evaluating platforms, what is the key factor in ensuring a platform addresses an organization's needs?
    8·1 answer
  • Please choose the correct answer please tell fast​
    15·1 answer
  • Which subunit of a heterodimeric cdk is the regulatory subunit?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!