Created
April 21, 2016 20:34
-
-
Save Signifies/d0a7dc5d802ec0485781b2ddd912d717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cctype> | |
#include <iomanip> | |
#include <fstream> | |
#include <string> | |
using namespace std; | |
/*Student Name: Evan Stuehmer | |
Course: COP 2000 | |
Instructor: Calvert | |
Assignment | |
Code URL: https://gist.github.com/ES359/433e6652b4eff344f7d4 | |
*/ | |
int input(); | |
void bubbleSort(int arr[], int size); | |
int values[10]; | |
int main() | |
{ | |
input(); | |
bubbleSort(values, 10); | |
write(); | |
return 0; | |
} | |
int input() | |
{ | |
int num; | |
int a; | |
for (int i = 0; i <10; i++) | |
{ | |
cout << "Please enter a number."; | |
cin >> num; | |
a = values[num]; | |
} | |
return a; | |
} | |
void bubbleSort(int arr[], int size) | |
{ | |
bool swap; | |
int temp; | |
do | |
{ | |
swap = false; | |
for (int count = 0; count < (size - 1); count++) | |
{ | |
if (arr[count] > arr[count + 1]) | |
{ | |
temp = arr[count]; | |
arr[count] = arr[count + 1]; | |
arr[count + 1] = temp; | |
swap = true; | |
} | |
} | |
} while (swap); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment