SUBMISSION+RYAN

code /* CHALLENGE 1 RYAN WONG */


 * 1) include

using namespace std;

int main {   int Tables[10] = {88, 44,-21,0,23, 8, -34}; int i, selection, max, min, total, average, num, occ; int reverse[10]; max=0, min=0, total=0, occ=0, num=0;

cout << "\nMenu\n"; cout << "-" << endl; cout << "1. Find Maximum.\n"; cout << "2. Find Minimum.\n"; cout << "3. Find Average.\n"; cout << "4. Find number of times a number appears in the array.\n"; cout << "5. Reverse the order of an array.\n";

cout << "\nEnter your choice: >"; cin >> selection;

if (selection==1){

for (i=0;i<10;i++){ if(Tables[i]>max){ max = Tables[i]; }            }

cout << "The maximum is " << max << endl; }

else if (selection==2){

for (i=0;i<10;i++){ if(Tables[i]> num; cout << endl;

for(i=0;i<10;i++){ if(num==Tables[i])occ++; }

cout << "The number of times the number " << num << " appeared is " << occ << endl; }

else if (selection==5){

cout << endl << "The reversed array is {"; for(int i=1; i<=10; i++){ cout << Tables[10-i]; if (i != 10){ cout << ","; }                   } }

system ("PAUSE"); return 0; }

code code /*Challenge 2 Ryan Wong */


 * 1) include

using namespace std;

int main{ char Allocations[5] = {'z','v','e','a','b'}; char c;   int i, j;

for (j=0; j<5; j++){ for (i=0; i<5-j; i++) { if (Allocations[i]>Allocations[i+1]) { c = Allocations[i]; Allocations[i]=Allocations[i+1]; Allocations[i+1]=c; } } }

for(i=1; i<6; i++) { cout << Allocations[i]<< " <3 ";       //spread the love }       cout << endl;

system("PAUSE");

return 0; }

code