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
andrew11 [14]
3 years ago
9

The program prompts the user to interactively enter eight batting averages, which the program stores in an array. The program sh

ould then find the minimum and maximum batting average stored in the array as well as the average of the eight batting averages. The data file provided for this lab includes the input statement and some variable declarations. Comments are included in the file to help you write the remainder of the program.
Instructions
Ensure the source code file named BattingAverage.cpp is open in the code editor.
Write the C++ statements as indicated by the comments.
Execute the program by clicking the Run button. Enter the following batting averages: .299, .157, .242, .203, .198, .333, .270, .190. The minimum batting average should be .157, and the maximum batting average should be .333. The average should be .2365
Computers and Technology
1 answer:
puteri [66]3 years ago
7 0

Answer:

The explanation and solution of this question is given below in explanation section. This program is written in c++ using dev C++. This below program run accurately according to requirement of the given question. While explanation of code is commented in the program.

Explanation:

// Example program

#include <iostream>

#include <string>

using namespace std;

int main()

{

 

   double number[8];// user enter eight batting average

   double average=0.0;// average of all 8 batting

   

   for (int i=0; i<8; i++)// prompt user to enter batting average interactively

   {    

       cout<<"Please enter batting average of "<<i<<"\n";

       cin>>number[i];       // store batting average into array

       

   }

   

   double  max = number[0];// maximum average variable declaration

   for (int i = 0; i < 8; i++)//loop to find max average

   {

       if (max < number[i])

           max = number[i];

   }

double min = number[0];//minimum average variable declaration

   for (int i = 0; i < 8; i++)//loop to find minimum average

   {

       if (min > number[i])

           min = number[i];

   }

   cout << "The maximum batting average is : " << max<<"\n";//display maximum average

   cout << "The minimum batting average is : " << min<<"\n";//display minimum average

   

     

       for (int i=0; i<8; i++)//loop to calculate the average

   {    

       

       average=average+number[i];// sum of all averages

       

   }

   average=average/8;//average of eight batting averages

   cout<<"The average is "<<average<<"\n";//display the average

   

 return o;  

}

You might be interested in
When double quotes are used to assign values to string variables, the PHP interpreter must check the entire string to see if it
NikAS [45]

Answer:

Interpolation string.

Explanation:

The proces of adding the variable in middle the string.The interpolation  Replace the value of the Variable when the string data is processed .In the Interpolation process  the variable is permitted with string containing double quotes.In the interpolation string  the interpreter check the entirely string that  the variable in middle the string.

Following is the example of interpolation string in Php

$n1 = "RAM";

echo "hello $name"; // output

Output:

hello RAM

6 0
2 years ago
(Q003) The difference between a parameter and an exogenous variable is that Group of answer choices a parameter is allowed to ch
ozzi

Answer:

a parameter is fixed over time, while an exogenous variable is allowed to change over time.

Explanation:

A parameter can be defined as a value that can be passed to a function. Thus, a parameter refers to a value that must be passed into a function, subroutine or procedure when it is called.

This value can be passed to a function either by reference or by value.

Basically, parameters can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function.

A variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited. Thus, a variable stores information which is passed from the location of the method call directly to the method that is called by the program.

An exogenous variable can be defined as a that's independent of other variables in a system i.e it's not affected by other variables.

This ultimately implies that, the difference between a parameter and an exogenous variable is that a parameter is fixed over time, while an exogenous variable is allowed to change over time and as such it has a relationship with other variables in a system.

3 0
2 years ago
Hola, alguien me puede ayudar¡¡¡¡¡¡¡¡¡¡¡¡
WARRIOR [948]
Hola<span>, </span>Alguien me<span> podría </span>ayudar<span> a realizar una buena sinopsis de la película "</span><span>Jardín de Amapolas" dirigida por Carlos Melo Guevara, gracias? i hope i helped you</span>
4 0
3 years ago
The P in SOAP stands for Persuasion. <br> a. True<br> b. False
fredd [130]
The answer is false.
  P in soap stands for purpose. SOAPS stands for Subject(what is being discussed), Occasion(what is the context of events), Audience(to whom the message is directed), Purpose(what is the recommended action for the reader) and the Speaker(what or who is the source).
4 0
2 years ago
Read 2 more answers
If more than 4 feet of track is needed, at least one additional support must be installed for every extension of ___ feet or les
Elena-2011 [213]

If more than 4 feet of track is needed at least one additional support must be installed for every extension of <u>4 </u> feet or less.

<h3>What is Feet in Electrical Installation system?</h3>

In the electrical installation system, the inside wall of a system e.g

  • indoor spa or
  • indoor pool

is usually grounded or GFCI protected (A ground fault circuit interrupter) for indoor convenience.

For a chosen electrical outlet, the maximum receptacle distance in a household must be at least 12 feet apart using floor line measurement.

From the given question:

  • If more than 4 feet of track is needed at least one additional support must be installed for every extension of <u>4 </u> feet or less.

Learn more about electrical installation systems here:

brainly.com/question/24786034

3 0
2 years ago
Other questions:
  • Which type of system would be more reliable for keeping a plane traveling at constant speed – an automatically controlled feedba
    11·1 answer
  • If given the chance to own manage a business,what will be the name of the business?
    11·2 answers
  • Eric would like to have a color textbook that makes it look as if the character in an image is speaking. Which object should he
    14·1 answer
  • Which of the following is the correct ordering of operating systems, oldest to newest?
    5·2 answers
  • Suppose testcircle1 and circle1 in listing 9.1 are in two separate files named testcircle1.java and circle1.java, respectively.
    14·1 answer
  • Which of the following software is an
    8·2 answers
  • What is the setting an alarm clock output??
    10·1 answer
  • How do I go to files in Brainly I need help
    13·1 answer
  • In 1839, Talbot released the paper-based process which he called _ to the public.
    5·1 answer
  • To behave ethically means
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!