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
Which question can most help a writer revise an argumentative essay?
Jobisdone [24]
Do details provide support for the claim
7 0
3 years ago
Read 2 more answers
What is a form of technology that you think will make your life easier?
zzz [600]

Answer:

Digital communication technologies

Explanation:

connecting people across the globe has become easier and faster. Platforms such as Zoom, Room, Microsoft teams, WebEx, and many others are buzzing virtual world spaces to connect and share.

5 0
2 years ago
Adassadad saflalfaklfajfklajfalkfjalkfjalkfalkf
BlackZzzverrR [31]

Answer:

this belongs on r/ihadastroke

Explanation:

5 0
3 years ago
Read 2 more answers
Which term is defined by the total operating current of a circuit?
Mamont248 [21]

Answer:

OK PERO NOSE LM SOTTY BROTHER

Explanation:

6 0
2 years ago
Special keys that allow you to use the computer to perform specific functions
Pavel [41]

Answer:

Examples are Ctrl, Alt, Fn, Alt Gr, Shift, Caps Lock, Tab, Scroll Lock, Num lock, Esc, Windows Key, Backspace, Enter...

8 0
3 years ago
Other questions:
  • To clean dirt and spilled electrolyte from a battery, use a dilute solution of either water and baking soda or water and A. sulf
    13·1 answer
  • ________ is used to store programs and instructions that are automatically loaded when the computer is turned on.
    14·1 answer
  • Henrietta, the owner of a very successful hotel chain in the Southeast, is exploring the possibility of expanding the chain into
    15·1 answer
  • A marketing associate wants to use the Validate button to ensure an email is CAN-SPAM compliant. What information does the assoc
    5·2 answers
  • WHAT SO THESE THINGS THAT I'VE HIGHLIGHTED MEAN IN MICROSOFT WORD?
    12·1 answer
  • write a program that asks the user to enter a positive integer, then prints a list of all positive integers that divide that num
    6·1 answer
  • In Microsoft Word you can access the _______ command from the "Mini toolbar." 
    9·1 answer
  • Consider the following method, inCommon, which takes two Integer ArrayList parameters. The method returns true if the same integ
    15·1 answer
  • Create a basic program that accomplishes the following requirements: Allows the user to input 2 number , a starting number x and
    12·1 answer
  • When can designers use rapid application development?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!