Please Write C Program Accept List Integers 20 User List Show Numbers Ascending Order Sort Q43788923
Please write a C++ program that will accept alist of integers (up to 20) from the user into alist, and then show those numbers in ascendingorder (after being sorted by your sort function),the sum of all integers, and their average. Then, your programallows the user to search for a number in the list. If the number(from the user) is in the list, please show its index position inthe list, otherwise please say the number is not found. To makeyour program really user-friendly, the index position should startfrom 1, not 0. Please stop the search game if the user enters-99 as a number to search. Then, you continue toaccept another list of integers (up to 20) from the user. Pleasestop your program with a thank-you message if the user enterszero as the number of integers to play. Please seethe sample test below to design your applicationprogram properly. This program is like a game of sortingand searching for users to play.
You must write your sort function to sort theintegers in the list. You may use any sorting technique to sort thenumbers. You must write your search function tosearch for the number requested by the user. Please usebinary search instead of sequentialsearch technique because the list has been sorted alreadyby your sorting function. You may reference the textbook for somesorting and searching algorithms. You must notcall/use the existing sort( ) method for list inyour program.
The following is a sample test,
Welcome to the List Sorting and Searching programdesigned by “your name”
Please enter how many integers you would like to play (up to 20,0 to stop) > 5
Please enter number> 2
Please enter number> 5
Please enter number> 3
Please enter number> 4
Please enter number> 1
Your 5 integers in ascending order are: 1 2 3 45
The sum of all integers is 15, and their average is3
Please enter a number to search (-99 to end the search)>4
The number 4 is found at the position 4
Please enter a number to search (-99 to end the search)>44
The number 44 is not found.
Please enter a number to search (-99 to end the search)>1
The number 1 is found at the position 1
Please enter a number to search (-99 to end the search)>-99
Please enter how many integers you would like to play (up to 20,0 to stop) > 6
Please enter number> 9
Please enter number> 20
Please enter number> 5
Please enter number> 3
Please enter number> 34
Please enter number> 18
Your 6 integers in ascending order are: 3 5 9 18 2034
The sum of all integers is 89, and their average is14
Please enter a number to search (-99 to end the search)>34
The number 34 is found at the position 6
Please enter a number to search (-99 to end the search)>19
The number 19 is not found.
Please enter a number to search (-99 to end the search)>3
The number 3 is found at the position 1
Please enter a number to search (-99 to end the search)>20
The number 20 is found at the position 5
Please enter a number to search (-99 to end the search)>-99
Please enter how many integers you would like to play (up to 20,0 to stop) > -99
Please enter how many integers you would like to play (up to 20,0 to stop) > -4
Please enter how many integers you would like to play (up to 20,0 to stop) > 0
Thank you for using program by “your name”
Expert Answer
Answer to Please write a C++ program that will accept a list of integers (up to 20) from the user into a list, and then show those…
OR