Code: C++
Write a very general sort method that can sort any typeof data arrays/lists. For example, can sort a list of integers inascending order, a list of integers in descending order, a list ofdoubles, a list of student objects (with names and scores) inascending order of names, or in descending order of scores, … Youcan use any pre-defined sort function or can code your own. Useyour favorite language for implementation. If your language doesn’tsupport these features, implement a revised version (clearly statethe revision you made to the problem with a brief discussion of thelanguage’s weakness.) Then test the following cases:
(a) 4, 3, 7, 2, 1, 9 in ascending order
(b) 4.5, 2.0, 9.0, 8.4, 7.2, 6.1, 20.5, 2.1 indescending order
(c) John 40, Casey 45, Ben 47, Zadi 41, Kay 39, Tay 43in ascending order of names