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]
4 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]4 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
"The principle of ______________ states that programs tend to access data and instructions nearby recently used data and instruc
maria [59]

Answer:

<em>Locality of reference.</em>

Explanation:

In computing, The principle of locality of reference is the probability of a processor to repeatedly access the same set of memory locations within a small time interval. This reference of locality can be spatially based (repetitive usage of data within the same location on the computer memory), or temporally based (repetitive usage of a particular data or resources within a shot time interval). The ability of some computing system to perform this action increases their predictability, and efficiency of memory hierarchy use, among other abilities.

4 0
3 years ago
Which of these is a physical health benefit provided by playing team sports? A. a spiritual connection to others B. lower choles
AfilCa [17]

Answer:

B. lowering cholesterol

Explanation:

Edge 2021, made a 100 on the quiz. Good luck :)

3 0
3 years ago
Read 2 more answers
Ch. 6 Agile Modeling &amp; Prototyping SDLC vs. Prototyping "I’ve got the idea of the century!" proclaims Bea Kwicke, a new syst
larisa86 [58]

Answer:

Refer below.

Explanation:

A.The SDLC ought not be rejected for each venture since certain frameworks might be rashly molded before the issue or opportunity being tended to is altogether comprehended. Additionally, utilizing prototype as an option may bring about utilizing a framework that is acknowledged by explicit gathering of clients yet which is insufficient for in general framework needs. In numerous framework prototyping can be effectively incorporated with SDLC approach. For surely knew frameworks, a straight SDLC approach has demonstrated its value.

B.In epic or complex circumstance, prototyping is a perfect mechansim for better understanding client prerequisites, and for getting client input for improving framework viability. What's more, prototyping has demonstrated valuable when fused into SDLC. This combination is especially helpful in better learning client needs.

4 0
3 years ago
Development of smart phone​
Delvig [45]

Answer:

The first smartphone, created by IBM, was invented in 1992 and released for purchase in 1994. It was called the Simon Personal Communicator (SPC). While not very compact and sleek, the device still featured several elements that became staples to every smartphone that followed.

4 0
3 years ago
The act of deliberately accessing computer systems and networks without authorization is generally known as _____.
Anuta_ua [19.1K]

it is known as hacking

3 0
3 years ago
Other questions:
  • In a survey of 7200 T.V. viewers, 40% said they watch network news programs. Find the margin of error for this survey if we want
    6·1 answer
  • A client is concerned that a power outage or disaster could impair the computer hardware's ability to function as designed. The
    13·1 answer
  • what happens when you double-click on a file with an extension that represents an executable program?
    5·1 answer
  • What does nat stand for? network access trigger network administration timetable network address translation network association
    13·1 answer
  • A ____ is a collection of computers and users that are identified by a common security database. workgroup controller segment do
    7·1 answer
  • Where is the start frame delimiter found in the Ethernet frame
    9·1 answer
  • I was designed to meet the computing needs of an individual. I was originally referred to as ___________________.
    7·1 answer
  • You already know how to use lists. What is the index of 5 in the following list? [2, 3, 5, 1, 6]
    11·2 answers
  • ¿Cómo afecta negativamente a las relaciones familiares el uso de la tecnología?
    7·1 answer
  • Hardware failure, power outages, and DOS attacks will affect:
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!