#include  #include  using namespace std; int main() {    // Declare a named constant for array size here        // Declare array here        // Use this integer variable as your loop index    int loopIndex;     // Use this variable to store the batting average input by user    double battingAverage;    // Use these variables to store the minimim and maximum values    double min, max;    // Use these variables to store the total and the average    double total, average;     // Write a loop to get batting averages from user and assign to array           cout << "Enter a batting average: ";       cin >> battingAverage;       // Assign value to array           // Assign the first element in the array to be the minimum and the maximum    min = averages[0];    max = averages[0];    // Start out your total with the value of the first element in the array    total = averages[0];     // Write a loop here to access array values starting with averages[1]           // Within the loop test for minimum and maximum averages.              // Also accumulate a total of all averages                       // Calculate the average of the 8 batting averages         // Print the batting averages stored in the averages array         // Print the maximum batting average, minimum batting average, and average batting average        return 0;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
#include <iostream>
#include <string>
using namespace std;

int main()
{
   // Declare a named constant for array size here
   

   // Declare array here
   

   // Use this integer variable as your loop index
   int loopIndex; 

   // Use this variable to store the batting average input by user
   double battingAverage;

   // Use these variables to store the minimim and maximum values
   double min, max;

   // Use these variables to store the total and the average
   double total, average; 

   // Write a loop to get batting averages from user and assign to array
   
      cout << "Enter a batting average: ";
      cin >> battingAverage;
      // Assign value to array
      
   // Assign the first element in the array to be the minimum and the maximum
   min = averages[0];
   max = averages[0];
   // Start out your total with the value of the first element in the array
   total = averages[0]; 
   // Write a loop here to access array values starting with averages[1]
   
      // Within the loop test for minimum and maximum averages.
      
      // Also accumulate a total of all averages
      
   
       
   // Calculate the average of the 8 batting averages 
   

   // Print the batting averages stored in the averages array 
   
   // Print the maximum batting average, minimum batting average, and average batting average
   
   return 0;
}
DOLO GY
us.battle.net
Password C
Contact Sup
enterprise re
f (1) Frontline
My Questicr
26 https://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=9781337274609&id
CENGAGE MINDTAP
min v
Array Basics in C++
ome
BattingA
Array Basics
ses
1 #incl
program that uses an array.
2 #incl
og and Study Tools
3 using
The program prompts the user to interactively enter
eight batting averages, which the program stores in an
4
ner Offers
5 int ma
array. The program should then find the minimum
and maximum batting average stored in the array as
cal Options
/>
6 {
ege Success Tips
well as the average of the eight batting averages. The
data file provided for this lab includes the input
eer Success Tips
10
statement and some variable declarations. Comments
11
NDED FOR YOU
are included in the file to help you write the remainder
of the program.
12
13 //L
14 int
15
Instructions
16
17
doub
1. Ensure the source code file named
Stop Procrastinating
18
BattingAverage.cpp is open in the code editor.
19
20
doubl
lelp
2. Write the C++ statements as indicated by the
21
comments.
22
//Us
Sive Feedback
23
doubl
3. Execute the program by clicking the Run button.
24
Enter the following batting averages: .299, .157,
25
/Wr:
242, .203, .198, .333, .270, .190. The minimum
26
27
COL
batting average should be.157, and the maximum
28
cir
batting average should be .333. The average
29
should be .2365.
Be
31
WAss.
min
Grading
!!
max
//Star
When you have completed your program, click the
Submit button to record your score.
total
36
//Writ
37
Type here to search
38
o 耳 e
3)
!!
Transcribed Image Text:DOLO GY us.battle.net Password C Contact Sup enterprise re f (1) Frontline My Questicr 26 https://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=9781337274609&id CENGAGE MINDTAP min v Array Basics in C++ ome BattingA Array Basics ses 1 #incl program that uses an array. 2 #incl og and Study Tools 3 using The program prompts the user to interactively enter eight batting averages, which the program stores in an 4 ner Offers 5 int ma array. The program should then find the minimum and maximum batting average stored in the array as cal Options /> 6 { ege Success Tips well as the average of the eight batting averages. The data file provided for this lab includes the input eer Success Tips 10 statement and some variable declarations. Comments 11 NDED FOR YOU are included in the file to help you write the remainder of the program. 12 13 //L 14 int 15 Instructions 16 17 doub 1. Ensure the source code file named Stop Procrastinating 18 BattingAverage.cpp is open in the code editor. 19 20 doubl lelp 2. Write the C++ statements as indicated by the 21 comments. 22 //Us Sive Feedback 23 doubl 3. Execute the program by clicking the Run button. 24 Enter the following batting averages: .299, .157, 25 /Wr: 242, .203, .198, .333, .270, .190. The minimum 26 27 COL batting average should be.157, and the maximum 28 cir batting average should be .333. The average 29 should be .2365. Be 31 WAss. min Grading !! max //Star When you have completed your program, click the Submit button to record your score. total 36 //Writ 37 Type here to search 38 o 耳 e 3) !!
My Questic
enterprise re
f (1) Frontline
Contact Sup
us.battle.ne
Password C
o https://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=9781337274609&id%3D
CENGAGE MINDTAP
Array Basics in C++
Array Basics
BattingAve
1 #includ
Study Tools
2 #includ
Summary
3 using na
rs
4
In this lab, you complete a partially prewritten C++
</>
5 int mair
ns
program that uses an array.
/De
cess Tips
The program prompts the user to interactively enter
cess Tips
eight batting averages, which the program stores in an
/Dec
10
array. The program should then find the minimum
and maximum batting average stored in the array as
11
OR YOU
12
well as the average of the eight batting averages. The
data file provided for this lab includes the input
13
//Use
14
int lo
15
statement and some variable declarations. Comments
16
/ Use
are included in the file to help you write the remainder
17
double
of the
program.
18
ocrastinating
19
WUse
Instructions
(20
double r
21
1. Ensure the source code file named
22
/A Use t
back
23
double t
BattingAverage.cpp is open in the code editor.
24
25
AWrite
2. Write the C++ statements as indicated by the
26
comments.
127
cout
28
cin >>
3. Execute the program by clicking the Run button.
29
// Ass
Enter the following batting averages: .299, .157,
uatssy //
aver
31
.242, .203, .198, .333, .270, .190. The minimum
32
min
batting average should be.157, and the maximum
33
max
aver
batting average should be .333. The average
34
//Start a
total
av
should be .2365.
36.
W Nrite a
37
Grading
// withi
O # e a
Type here to search
3
!!
Transcribed Image Text:My Questic enterprise re f (1) Frontline Contact Sup us.battle.ne Password C o https://ng.cengage.com/static/nb/ui/evo/index.html?elSBN=9781337274609&id%3D CENGAGE MINDTAP Array Basics in C++ Array Basics BattingAve 1 #includ Study Tools 2 #includ Summary 3 using na rs 4 In this lab, you complete a partially prewritten C++ </> 5 int mair ns program that uses an array. /De cess Tips The program prompts the user to interactively enter cess Tips eight batting averages, which the program stores in an /Dec 10 array. The program should then find the minimum and maximum batting average stored in the array as 11 OR YOU 12 well as the average of the eight batting averages. The data file provided for this lab includes the input 13 //Use 14 int lo 15 statement and some variable declarations. Comments 16 / Use are included in the file to help you write the remainder 17 double of the program. 18 ocrastinating 19 WUse Instructions (20 double r 21 1. Ensure the source code file named 22 /A Use t back 23 double t BattingAverage.cpp is open in the code editor. 24 25 AWrite 2. Write the C++ statements as indicated by the 26 comments. 127 cout 28 cin >> 3. Execute the program by clicking the Run button. 29 // Ass Enter the following batting averages: .299, .157, uatssy // aver 31 .242, .203, .198, .333, .270, .190. The minimum 32 min batting average should be.157, and the maximum 33 max aver batting average should be .333. The average 34 //Start a total av should be .2365. 36. W Nrite a 37 Grading // withi O # e a Type here to search 3 !!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education