C++ Coding Homework
Write a program to sort n number of random integers in ascending order using the bubble sort
algorithm. Run the code in online C++ compiler: [Link]
• The number of integers n must be user defined (input from the user during execution)
• Use the following to generate random integers from -1000 to 1000:
• C++ header needed for random numbers:
• C++ function to seed the rand() function:
• C++ statement to generate random integers:
• Encapsulate the data generation (array of random integers) and the bubble sort algorithm in a
class object.
• The main() should look like this:
1
C++ Coding Homework
• Test your code by inputting 10, 15, and 20 as the Input array size.
• The output should look like this:
Example 1: Example 2: Example 3: