Question: Rewrite your League program from Assignment 5 so that it uses Dynamic Memory Allocation ( DMA ) to create the team names and scores arrays.

Rewrite your League program from Assignment 5 so that it uses Dynamic Memory Allocation (DMA) to create the team names and scores arrays.
This is a good test of the modularity of your program. You will only need to make slight modifications to your main() function if you wrote your original program using functions similar to the following:
void initializeData(string names[], int wins[], int size)
void sort (string names[], int wins[], int size)
void display(string names[], int wins[], int size)
Your modified league program should start out by asking the user how many teams will be entered. It should then dynamically allocate two appropriate arrays, and proceed just like the original League assignment, calling the above three functions. When your program is done using the arrays, don't forget to use delete [] to return their memory to the system.
Note: you must use dynamic memory allocation for your arrays, i.e. the new and delete [] operators, to receive credit.
The output from your program should look approximately like this (user input in orange bold):
How many teams will you enter?: 4
Enter team #1: Padres
Enter the wins for team #1: 75
Enter team #2: Dodgers
Enter the wins for team #2: 91
Enter team #3: Giants
Enter the wins for team #3: 92
Enter team #4: Cubs
Enter the wins for team #4: 65
League Standings:
Giants: 92
Dodgers: 91
Padres: 75
Cubs: 65
#include =5i=0ii=0i++[j]
 Rewrite your League program from Assignment 5 so that it uses

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!