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
Write a SELECT statement that returns a single value that represents the sum of the largest unpaid invoices submitted by each ve
Wittaler [7]

Answer:

Create table vendor(vendor_id int,due_invoice int,invoiceTotal int);

Create view v as select vendor_id,max(due_invoice) as unpaid from vendor;

Select sum(unpaid) from v;

Select vendor_id,invoiceTotal from vendor group by vendor_id;

5 0
3 years ago
Internally, computers are constructed from circuitry that consists of small on/off switches. What is the most basic circuitry-le
attashe74 [19]

Answer:

Machine Language.

Explanation:

The most basic language that is used by computers so that they can control the operation of the on/off switches  in the circuitry is Machine language.

Machine Language is a low level language is a collection of binary digits or bits that is understood by the computers.Computers are capable of understanding only machine language.

3 0
3 years ago
What is an example of how pseudo - randomness is used to creative variation​
Hitman42 [59]

its just one word pseudorandom not a space in the middle

3 0
3 years ago
An interface does not have ____.
Svetradugi [14.3K]

Answer:

B - instance fields

Explanation:

Fields/variables declared within interfaces are by default final, public or static and hence will not be considered as an instance variable/field but a class variable. Although interfaces can be used to define instance methods, they will never have instance variables.

5 0
3 years ago
Kenny FRIEND ME. Ps that is my brother
Maslowich

Answer:

who is kenny

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • 2. Write the binary representation of number 1037.379 in IEEE 754 standard in single precision. Express the result in binary, oc
    7·1 answer
  • Which type of system must you connect to and use to make changes to Active Directory?
    15·1 answer
  • 1. How does inertia affect a person who is not wearing a seatbelt during a collision? 
    14·2 answers
  • what is it called when you are biying and selling products via electronic channels such as the internet​
    13·2 answers
  • With which type of media are you interacting when you read an online shopping website?
    7·1 answer
  • What are some difficulties in synchronizing audio and video during telecine transfer? (Select all that apply.)
    13·1 answer
  • How many people on here are doing edmentum online
    11·1 answer
  • 75 pts. Conduct online research about 10 of the most famous and dangerous computer viruses that threatened computer networks aro
    13·1 answer
  • When you type in text in an image in a photo-editing software, where is it created?
    8·1 answer
  • Suppose in an Excel spreadsheet, the value in cell A1 is 25. By using the Macabacus local currency cycle shortcuts (Ctrl + Shift
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!