Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program, which will ask the user how many whole numbers they wish to ent

ID: 3653997 • Letter: W

Question

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order. All numbers entered and displayed will be integer values. All numbers must be validated upon entry. The maximum number of integers to be handled will be 20. Sorting will be done in a function where the array will be the first parameter and the number of integers entered into the array will be the second parameter. Use an array to store the integer values. Use the bubble sort algorithm provided in class.

Explanation / Answer

#include using namespace std; void BubbleSort(int* &theArray, int size) { int i, j, flag = 1; // set flag to 1 to start first pass int temp; // holding variable int numLength = size; for(i = 1; (i size; } //Create the array with the specified size theArray = new int[size]; //Get the input into the array for(int i = 0; i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote