Answered Essay: ECE 216 Programming Project 2 The Bubble Sort You will create a simple Bubble Sort program to sort a s

Please read the instructions carefully

I need a program using visual studios to do the bubble sort
Please send me the full code, and take a screenshot of the output
This is suppose to do the swapping operation as well.
The example is there
If possible, send screenshots/instructions so I will know how to do it as well
ECE 216 Programming Project 2 The Bubble Sort You will create a simple Bubble Sort program to sort a string of random integers or text or whatever you can punch in from the keyboard. For the input data, you will input a string of single digit ASCII characters, at least 20 of them, in some sort of random order. You arent limited to 20. Put in 100 if you like. For the output data, you will simply print this string after it is sorted. For the process, you will sort the data in either descending order (largest value first smallest value last) or ascending order, but you can allow for both possibilities if you wish In order to sort the data, you will need to develop the algorithm for a bubble sort, then create a flow chart or pseudocode so you will understand the process, and finally code it. The bubble sort is perhaps the easiest of the sorting algorithms to write. The basic principle is to simply compare two adjacent numbers. If they are in order, then leave them alone and move to the next pair. If they are out of order, swap their positions in memory, and then move onto the next pair Here is a simple example using 5 numbers. 18496 Start: 1 pass: compare 1 to 8 out of order, swap them now have: 81496 now have: now have: now have: 2nd pass: compare 1 to 4 84196 compare 1 to 9 84916 compare 1 to 6 84961 out of order, swap them out of order, swap them out of order, swap them compare 8 to 4 compare 4 to 9 in order, no swap out of order, swap them now have: 89461 compare 4 to 6 compare 4 to 1 compare 8 to 9 out of order, swap them in order, no swap out of order, swap them now have: 89641 3rd pass: now have: 98641 compare 8 to 6 compare 6 to 4 compare 4 to1 in order, no swap in order, no swap in order, no swap
media%2Fa59%2Fa59353ac-e9fd-4654-8dc6-87
media%2F99a%2F99abf6c8-98bf-412d-88fe-be

ECE 216 Programming Project 2 The Bubble Sort You will create a simple Bubble Sort program to sort a string of random integers or text or whatever you can punch in from the keyboard. For the input data, you will input a string of single digit ASCII characters, at least 20 of them, in some sort of random order. You aren’t limited to 20. Put in 100 if you like. For the output data, you will simply print this string after it is sorted. For the process, you will sort the data in either descending order (largest value first smallest value last) or ascending order, but you can allow for both possibilities if you wish In order to sort the data, you will need to develop the algorithm for a bubble sort, then create a flow chart or pseudocode so you will understand the process, and finally code it. The bubble sort is perhaps the easiest of the sorting algorithms to write. The basic principle is to simply compare two adjacent numbers. If they are in order, then leave them alone and move to the next pair. If they are out of order, swap their positions in memory, and then move onto the next pair Here is a simple example using 5 numbers. 18496 Start: 1 pass: compare 1 to 8 out of order, swap them now have: 81496 now have: now have: now have: 2nd pass: compare 1 to 4 84196 compare 1 to 9 84916 compare 1 to 6 84961 out of order, swap them out of order, swap them out of order, swap them compare 8 to 4 compare 4 to 9 in order, no swap out of order, swap them now have: 89461 compare 4 to 6 compare 4 to 1 compare 8 to 9 out of order, swap them in order, no swap out of order, swap them now have: 89641 3rd pass: now have: 98641 compare 8 to 6 compare 6 to 4 compare 4 to1 in order, no swap in order, no swap in order, no swap

Expert Answer

 

Here is the code for you:

#include <iostream>
#define SIZE 20
using namespace std;

//Prints the array to screen.
void printArray(char array[])
{
for(int i = 0; i < SIZE; i++)
{
cout << array[i] << ” “;
if((i+1)%10 == 0)
cout << endl;
}
cout << endl;
}

//Sorts the array using bubble sort.
void bubbleSort(char array[])
{
for(int i = 0; i < SIZE-1; i++)
for(int j = 0; j < SIZE-1; j++)
if(array[j] > array[j+1]) //Just change the > sign to < sign, if you want to sort in descending order.
{
char temp = array[j];
array[j] = array[j+1];
array[j+1] = temp;
}
}

int main()
{
char array[SIZE];
cout << “Enter 20 digits: “;
//Loop to read the input from the user.
for(int i = 0; i < SIZE; i++)
cin >> array[i];
//Prints the unsorted data to screen.
cout << “This is the original data, unsorted:” << endl;
printArray(array);
//Calls the method to sort the array.
bubbleSort(array);
//Prints the sorted data to screen.
cout << “This is the sorted data:” << endl;
printArray(array);
}

And the output screenshot is:

Buy Essay
Calculate your paper price
Pages (550 words)
Approximate price: -

Help Me Write My Essay - Reasons:

Best Online Essay Writing Service

We strive to give our customers the best online essay writing experience. We Make sure essays are submitted on time and all the instructions are followed.

Our Writers are Experienced and Professional

Our essay writing service is founded on professional writers who are on stand by to help you any time.

Free Revision Fo all Essays

Sometimes you may require our writers to add on a point to make your essay as customised as possible, we will give you unlimited times to do this. And we will do it for free.

Timely Essay(s)

We understand the frustrations that comes with late essays and our writers are extra careful to not violate this term. Our support team is always engauging our writers to help you have your essay ahead of time.

Customised Essays &100% Confidential

Our Online writing Service has zero torelance for plagiarised papers. We have plagiarism checking tool that generate plagiarism reports just to make sure you are satisfied.

24/7 Customer Support

Our agents are ready to help you around the clock. Please feel free to reach out and enquire about anything.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

HOW OUR ONLINE ESSAY WRITING SERVICE WORKS

Let us write that nagging essay.

STEP 1

Submit Your Essay/Homework Instructions

By clicking on the "PLACE ORDER" button, tell us your requires. Be precise for an accurate customised essay. You may also upload any reading materials where applicable.

STEP 2

Pick A & Writer

Our ordering form will provide you with a list of writers and their feedbacks. At step 2, its time select a writer. Our online agents are on stand by to help you just in case.

STEP 3

Editing (OUR PART)

At this stage, our editor will go through your essay and make sure your writer did meet all the instructions.

STEP 4

Receive your Paper

After Editing, your paper will be sent to you via email.

× How can I help you?