SUBMISSION+YONG+KEAT

Challenge 1

using namespace std; int main { int tables[10]={2,3,4,5,6,7,8,-1,0,1}; int times[10]={}; int i=1; int x=1; int max=-999999; int min=999999; float avg=0; for (i=0;i<10;i++) { if (tables[i]>max) { max = tables[i]; } if (tables[i]<min) { min = tables[i]; } avg += tables[i]; for (x=0;x<10;x++) { if (tables[i]==tables[x]) { times[x]++; } } } cout << "Max: " << max << endl; cout << "Min: " << min << endl; cout << "Avg: " << avg/i << endl; cout << "Number Repeat: " << endl; for (i=0;i<10;i++) { cout << i+1 << ": " << times[i] << endl; } cout << "Original Order: " << endl; for (i=0;i<10;i++) { cout << tables[i] << " "; } cout << endl << "Reverse Order: " << endl; for (i=0;i<10;i++) { times[i] = tables[9-i]; cout << times[i] << " "; } cout << endl; system("pause"); } --
 * 1) include

Challenge 2 (i am pretty unsure about what to use, so i did 2 pieces)

using namespace std;
 * 1) include

int main { int i,j; char DATA[5] = {'z','v','E','a','b'}; char DATAtmp[5] ={}; //loop through each character and make it lower-case. stop when you hit '\0'. for(int i = 0; DATA[i] != '\0'; i++){ DATAtmp[i] = tolower(DATA[i]); }

char tmp; for (i=1;i<5;i++) { for (j=0;j<5-i;j++) { if (DATAtmp[j]>DATAtmp[j+1]) { tmp = DATAtmp[j]; DATAtmp[j]=DATAtmp[j+1]; DATAtmp[j+1]=tmp; } } } for (i=0;i<5;i++) { for (j=0;j<5;j++) { if (DATAtmp[i] == tolower(DATA[j])) { DATAtmp[i] = DATA[j]; } } cout << DATAtmp[i] << " "; } cout << endl; system("pause");

} -- using namespace std; int main { char data[26] = {'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'}; int i,j; char tmp; for (i=0;i<26;i++) { for (j=0;j<26-i;j++) { if (data[j]>data[j+1]) { tmp = data[j]; data[j]=data[j+1]; data[j+1]=tmp; } } } for (i=1;i<27;i++) { cout << data[i] << " "; } cout << endl; system("pause");
 * 1) include

}

Done using Bloodshed C++, solutions can be obtained by running the program.