SUBMISSION+MARCUS

Enter your submission for both Challenges here. Make sure your label your solutions clearly.


 * Challenge 1**

using namespace std;
 * 1) include

int main { int lols[10], i, n, m, avg, findnum; int max = -123456789; int min = 123456789; int totavg = 0; int occ = 0; int length = 10;

cout << "Enter the following numbers: " << endl << endl; for(n=0;n<=(length-1);n++) { cout << n+1 << ": "; cin >> lols[n]; }

cout << "You have entered: "; for (i=0;i<=(length-1);i++) { cout << lols[i] << " "; }

cout << endl << endl;

for(i=0;i<=(length-1);i++) { if (lols[i] > max) { max = lols[i]; } }

for(i=0;i<=(length-1);i++) { if (lols[i] < min) { min = lols[i]; } else { min = min; } }

for(i=0;i<=(length-1);i++) { totavg += lols[i]; }

avg = totavg / length;

cout << "Max: " << max << endl << endl; cout << "Min: " << min << endl << endl; cout << "Average: " << avg << endl << endl;

cout << "Reversed Order: "; for(m=(length-1);m>=0;m--) { cout << lols[m] << " "; }

cout << endl << endl;

cout << "Enter integer for check of occurence: "; cin >> findnum; for(i=0;i<=(length-1);i++) { if(lols[i] == findnum) { occ++; } }

cout << "Number of occurence: " << occ << endl;

system("pause"); return 0; }


 * Challenge 2**

using namespace std;
 * 1) include

int main { char Allocations[5]; char tempo; int i, n, m; int length = 5;

cout << "Enter the following alphabets: " << endl for(n=0;n<=4;n++) { cout << n+1 << ": "; cin >> Allocations[n]; }

cout << "You have entered: "; for (i=0;i<=(length-1);i++) { cout << Allocations[i] << " "; }

cout << endl << endl;

for(i=0;i Allocations[n+1]){ tempo = Allocations[n]; Allocations[n] = Allocations[n+1]; Allocations[n+1] = tempo; } } }

cout << "Alphabetical Order: ";

for(m=0;m<=(length-1);m++) { cout << Allocations[m] << " "; }

cout << endl << endl;

system("pause"); return 0; }