Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab Test 2 (Chapter 7 - 10) Question: Write a program that dynamically allocates an array large enough to hold a user-defined number of test

image text in transcribed
image text in transcribed
image text in transcribed
Lab Test 2 (Chapter 7 - 10) Question: Write a program that dynamically allocates an array large enough to hold a user-defined number of test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the sorted list of scores and average with appropriate headings. Use pointer notation rather than array notation whenever possible. Expected output are the below. How many test scores will you enter? -2 The number cannot be negative. Enter another number: 3 Enter test score 1: 90 Enter test score 2: -80 Negative scores are not allowed. Enter another score for this test: 80 Enter test score 3: 70 The test scores in ascending order, and their average are: Score 70.00 80.00 90.00 Hverage score: 80.00 Press any key to continue .i include > nunTestScores: 10/100 1/ 1. Validate the input. 2. Allocate an array to hold the test scores. (dynamic memory allocation test ScorePtr- 1/ Fill the array with test scores. for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are M-1 and M-2? How may the Federal Reserve alter M-1 or M-2?

Answered: 1 week ago

Question

=+ when the client can call the function

Answered: 1 week ago