My teacher want me to create a program called Bubblesort and I dont know how to do it. Plz help me.
And these are description:

4.2.3 ASSIGNMENT: - Bubble Sort Program
In this exercise you will create a bubble sorting algorithm that will sort an array of random numbers in ascending order.

NEW CONCEPTS:
The starter code (below) contains code that will use the current time to “seed” the random number generator and then make calls to the random number generator rand() in order to fill each element in the array.

This code also makes use of a complier directive called #define. This allows the programmer to give a name to a number and then refer to that number by using its name in the body of the program. This way, if it is necessary to change the number, it only needs to be changed in one place. – where it is defined.

SETUP
2. Create a new cpp file and call it Bubble.cpp.
3. Copy and paste the following code into your Bubble.cpp

``````#include <iostream>
#include <time.h>
using namespace std;

#define SIZE    10

int main()
{
int nums[SIZE];
int i;
int j;
int temp;

//
// Populate the array with random numbers
//
srand( (unsigned)time( NULL ) );
for(i=0; i<SIZE; i++) {
nums[i] = rand();
}

//
// Display the array with each element separated by a space
//

//
// Sort the Array
//

//
// Display the sorted array with each element separated by a space
//

return 0;
}``````

KEY CONCEPTS:
The bubble sort starts at the beginning of the array and compares the first two numbers if the number on the right is less than the number on the left, the numbers are exchanged. Then it proceeds to compare the first number with the 3rd and then the first with the 4th, etc… After all comparisons, it moves to the second number and compares that with each element to the right.

In the example below, each step is shown in the sorting of 6 numbers. The bold numbers are the ones being compared. If the bold number to the right is greater, then the numbers are swapped and the resulting array is shown on the next line. This continues until each number has been compared with all others.

REFERENCE: C++ Beginners Guide, Project 4-1: Sorting an Array