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
When Clara accesses the programs and documents on her computer by way of icons, she is said to be employing
xxMikexx [17]
<span>D - graphical user interface</span>
5 0
3 years ago
When a JSP page is compiled, what is it turned into?
77julia77 [94]

Answer: Servlet

Explanation: JSP page compilation is the process of compiling of the file before it can be turned towards the live server .There is a request that is made towards the JSP page  then is compiled into a JSP servlet. Before the execution of the JSP program, it is turned in to a JSP servlet .JSP is a program that work on the server side and reduce the work load of the developers.

5 0
3 years ago
What is the status of this account?
nydimaria [60]

Answer:

the answer is A my mom is a accountant and she pretty much told me everything she knows... lol

Explanation:

plz give brainliest and rating hope this helps^_^

5 0
3 years ago
Read 2 more answers
Write a program that calculates and displays the amount ofmoney available in a bank account that initially has $8000 deposited i
Leviafan [203]

Answer:

Written in Python

import math

principal = 8000

rate = 0.025

for i in range(1, 11):

    amount = principal + principal * rate

    principal = amount

    print("Year "+str(i)+": "+str(round(amount,2)))

Explanation:

This line imports math library

import math

This line initializes principal amount to 8000

principal = 8000

This line initializes rate to 0.025

rate = 0.025

The following is an iteration from year 1 to 10

for i in range(1, 11):

    This calculates the amount at the end of the year

    amount = principal + principal * rate

    This calculates the amount at the beginning of the next year

    principal = amount

    This prints the calculated amount

    print("Year "+str(i)+": "+str(round(amount,2)))

6 0
3 years ago
Alice's public key, and sends back the number R encrypted with his private key. Alice decrypts the message and verifies that the
Agata [3.3K]

There are different kinds of keys. The identities of Alice and Bob are verified in this protocol.

<h3>What is public and private key in SSL?</h3>

These keys are known to be a kind of related pair of text files and they are often made together as a pair if one makes their Certificate Signing Request (CSR).

Note that the private key is different file that is often used in the encryption/decryption of data so as to sent a file between one's server and the connecting clients.

Learn more about  public/private key from

brainly.com/question/8782374

3 0
2 years ago
Other questions:
  • Matt wants to build an app that will reach many people all over the world. However, he worries about having to modify apps for a
    14·1 answer
  • 3.
    13·1 answer
  • If you are driving at night, you should not use high-beam headlights within _________ of oncoming vehicles. Florida Road Rules 4
    9·2 answers
  • _____ is defined as an attraction for a source based on a resemblance between the source and receiver of a message.
    15·1 answer
  • what aspect should you consider before adding pictures to a document? you should structure the first before you search for a rel
    15·2 answers
  • A location in memory used for storing data and given a name in a computer program is called a because the data in the location c
    14·1 answer
  • What is the difference between word processing software and email?
    12·2 answers
  • What will you see on the next line after the following lines of code?
    12·1 answer
  • What is the condition for setting an alarm clock
    11·1 answer
  • The _____ component of a decision support system (DSS) includes mathematical and statistical models that, along with the databas
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!