Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string>
- using namespace std;
- void nameSeparator(int separatorNumber)
- {
- cout << endl << "----------End of Daily ";
- cout << separatorNumber << "----------" << endl << endl;
- }
- //daily one stuff
- int sum, a, average, min, max;
- int numberArray[10] = { 100234,23,-5232,996,242,24,5239,-15,336,29 };
- //daily two stuff
- int steak;
- //daily 3 stuff
- int main()
- {
- cout << "Feels weird to have nothing here so, Hello World!" << endl << endl;
- nameSeparator(1); //end daily 1
- for (a = 0; a<10; a++)
- {
- sum += numberArray[a];
- average = sum / 10;
- if (numberArray[a] < min)
- {
- min = numberArray[a];
- }
- if (numberArray[a] > max)
- {
- max = numberArray[a];
- }
- }
- cout << "The sum of the values is: " << sum << endl;
- cout << "The average of the values is: " << average << endl;
- cout << "The minimum of the values is: " << min << endl;
- cout << "The maximum of the values is: " << max << endl;
- nameSeparator(2); //end of daily 2
- cout << "Orignally entered array is: " << endl;
- for (int a = 0; a<10; a++)
- {
- cout << numberArray[a];
- cout << ", ";
- }
- cout << endl << endl;
- for (int a = 0; a<9; a++)
- {
- for (int a = 0; a<9; a++)
- {
- if (numberArray[a]>numberArray[a + 1])
- {
- steak = numberArray[a];
- numberArray[a] = numberArray[a + 1];
- numberArray[a + 1] = steak;
- }
- }
- }
- cout << "Sorted Array is: " << endl;
- for (int a = 0; a<10; a++)
- {
- cout << numberArray[a];
- cout << ", ";
- }
- nameSeparator(3);
- //end of daily 3
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement