Write a C++ program that will calculate the average of a group of test scores, where...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that will calculate the average of a group of test scores, where the lowest score in the group will be dropped. The program should use the following functions: void getScores - will display a program output header (see output shown below) and then will ask the user to enter five test scores, calling the function readScore (see below), and then return the five scores to main using call-by-reference parameters. int readScore - will ask the user to enter one score and validate the score, requiring the user to re- enter the score as long as it is invalid. Note: A valid score is an integer between 0 and 100. float calcAverage - will receive the five scores from main and will calculate and return the average of the top four scores. This function will call the function findLowest (see below) to determine the lowest score. int findLowest - will receive the five scores and will return the lowest of the five scores. The main function will be the program driver, calling the above functions to handle input of scores, calculation and display of the average, and display of the dropped score. . Program requirements: a. The only function that may contain a cin statement is readScore. b. The only functions that may contain a cout statement are getScores, readScore, and main. c. Do not use any global variables. Output from a sample program run (user input in bold): Test Score Average Program Enter score (0-100): 90 Enter score (0-100): 60 Enter score (0-100): 50 Enter score (0-100): 80 Enter score (0-100): 70 Average = 75 Dropped score = 50 Write a C++ program that will calculate the average of a group of test scores, where the lowest score in the group will be dropped. The program should use the following functions: void getScores - will display a program output header (see output shown below) and then will ask the user to enter five test scores, calling the function readScore (see below), and then return the five scores to main using call-by-reference parameters. int readScore - will ask the user to enter one score and validate the score, requiring the user to re- enter the score as long as it is invalid. Note: A valid score is an integer between 0 and 100. float calcAverage - will receive the five scores from main and will calculate and return the average of the top four scores. This function will call the function findLowest (see below) to determine the lowest score. int findLowest - will receive the five scores and will return the lowest of the five scores. The main function will be the program driver, calling the above functions to handle input of scores, calculation and display of the average, and display of the dropped score. . Program requirements: a. The only function that may contain a cin statement is readScore. b. The only functions that may contain a cout statement are getScores, readScore, and main. c. Do not use any global variables. Output from a sample program run (user input in bold): Test Score Average Program Enter score (0-100): 90 Enter score (0-100): 60 Enter score (0-100): 50 Enter score (0-100): 80 Enter score (0-100): 70 Average = 75 Dropped score = 50
Expert Answer:
Answer rating: 100% (QA)
It seems like you have provided a task which is to develop a C program that calculates the average of a group of test scores excluding the lowest scor... View the full answer
Related Book For
Business Statistics In Practice
ISBN: 9780073401836
6th Edition
Authors: Bruce Bowerman, Richard O'Connell
Posted Date:
Students also viewed these programming questions
-
In this question assume that p and q are atomic formulae. (a) Compare and contrast path formulae and state formulae in temporal logic. [4 marks] (b) Describe and contrast the meanings of F(G p) and...
-
Magna Jets is a medium sized company that manufactures luxury goods for several well-known chain stores. In real terms, the company has experienced only a small growth in turnover in recent years,...
-
Use the depths (km) of the 600 earthquakes included in Data Set 21 "Earthquakes." Use a class width of 10.0 km and begin with a lower class limit of 0.0 km. Does the frequency distribution appear to...
-
Describe your first impressions of SAP.
-
The black lines show the emission or absorption lines observed in two spectra of the same element. Which one is an emission spectrum and which is an absorption spectrum? . .
-
A ball swings in a vertical circle at the end of a rope 1.50 m long. When the ball is 36.9 past the lowest point on its way up, its total acceleration is (22.5i + 20.2j) m/s2. At that instant, (a)...
-
Compute the company s net sales for the year. Compute the company s total cost of merchandise purchased for the year. Prepare a multiple - step income statement that includes separate categories for...
-
Land was acquired in 2021 for a future building site at a cost of $41,900. The assessed valuation for tax purposes is $27,300, a qualified appraiser placed its value at $50,000, and a recent firm...
-
The marketing and underwriting teams at Shelby Insurance have decided that they need some new forms and endorsements to address the growing cyber risk loss exposure. Which one of the following...
-
Inflation refers to the sustained boom inside the standard charge stage of merchandise and services through the years. As a financial corporation, inflation influences our clients' funding...
-
1.Based on your knowledge concerning capital budgeting, discuss several factors that would increase the risk associated with a company's capital investment decision. In your opinion explain which...
-
Accountants use the following to help ensure they use standardized approaches when making accounting decisions (example: how to account for a specific cost item) , Question 7 options: decision making...
-
This is not deductible from gross income Group of answer choices Travel expenses on a business trip Transportation expenses from home to the office and from the office to the home Transportation...
-
Hello i need help answering this question, I have attached part one, which I have done and figured out. After looking at that please help me answer part two with the break downs. Part two is the...
-
1-Stern observed all of the following results EXCEPT _______ in his experiment. A-one of the recombinant phenotypes was associated with an X chromosome of normal length B-the number of car, B+ male...
-
During 2004 a company implemented a number of policies aimed at reducing the ages of its customers' accounts. In order to assess the effectiveness of these measures, the company randomly selects 10...
-
In the book Production/Operations Management, William J. Stevenson presents a decision tree concerning a firm's decision about the size of a production facility. This decision tree is given in Figure...
-
During 2000 a company implemented a number of policies aimed at reducing the ages of its customers' accounts. In order to assess the effectiveness of these measures, the company randomly selects 10...
-
Consider the dynamic system, a mass, spring and damper structure, shown in Figure 2.2. (a) Draw a free-body diagram for the dynamic system (b) Derive the Input-Output model of the dynamic system k...
-
Two connected cars with an applied input force \(u(t)\) and negligible rolling friction can be represented by a translational mechanical system as shown below. (a) Draw the free-body diagrams of this...
-
Consider an RLC circuit consisting of a resistor \((R)\), an inductor \((L)\), and a capacitor \((C)\), connected in series, as depicted in Figure 2.4. Derive the Input-Output model of the network....
Study smarter with the SolutionInn App