Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago