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 type of message format is designed to arouse curiosity, not showing the product or delivering quite enough information to
Anarel [89]

The type of message format that is designed to arouse curiosity by not showing the product or delivering quiet enough information to make sense is teaser. This is a way of providing information that is short and in which it does not identify the product or the whole message itself. 

7 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
Kamila [148]

Answer:emphasis

Explanation:

7 0
3 years ago
the list of available fonts in the fonts gallery may differ, depending on what fonts you have installed and the type of printer
aalyn [17]
I believe the correct answer is true. The <span>list of available fonts in the fonts gallery may differ, depending on what fonts you have installed and the type of printer you are using. Not all fonts would be available in all computers and for all printers. It should be installed first before use.</span>
5 0
3 years ago
DO NOT JOIN ANY Z O O M MEETINGS FROM THIS PERSON! IS A TRAP Please help me get them banned!!!!!
s2008m [1.1K]

Answer:

how do i help?

Explanation:

7 0
3 years ago
Read 2 more answers
.حدد/ي الكيانات في النظام
olasank [31]

Answer:

what

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • What is a critique of the feature detector model of object recognition?​?
    8·1 answer
  • Which type of network topology has a central networking device which manages the network and acts as a communications conduit fo
    7·1 answer
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • Explain how the operating system controls the software and hardware on the computer?
    5·1 answer
  • pDevices used to prevent data from being written to a disk can connect to a computer through FireWire, SATA, PATA, and SCSI cont
    10·1 answer
  • TWO MINUTES LEFT<br> ________ __________ is the physical arrangement of devices on a network.
    9·1 answer
  • A total stranger is trolling Jack online. He’s offended and annoyed. How can Jack stop the troll in his or her tracks? (5 points
    10·2 answers
  • Para ti que es el sexting​
    11·1 answer
  • ________ are the symbolic codes used in assembly language?​
    6·1 answer
  • mary needs to rename her report.txt file to final_report.txt. which command will allow her to do this?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!