Question: Instead of the program sorting in ascending order, have it sort in descending order. #include //Line 1 #include arrayListType.h //Line 2 using namespace std; //Line

Instead of the program sorting in ascending order, have it sort in descending order.

#include //Line 1

#include "arrayListType.h" //Line 2

using namespace std; //Line 3

int main() //Line 4

{ //Line 5

arrayListType list; //Line 6

int num; //Line 7

cout << "Line 8: Enter numbers ending with -999"

<< endl; //Line 8

cin >> num; //Line 9

while (num != -999) //Line 10

{ //Line 11

list.insert(num); //Line 12

cin >> num; //Line 13

} //Line 14

cout << "Line 15: The list before sorting:" << endl; //Line 15

list.print(); //Line 16

cout << endl; //Line 17

list.selectionSort(); //Line 18

cout << "Line 19: The list after sorting:" << endl; //Line 19

list.print(); //Line 20

cout << endl; //Line 21

system("pause");

return 0; //Line 22

} //Line 23

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!