SUBMISSION+WEN+JUN

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

Don't worry about the fact that you are not familiar with syntax. With a few references you will be able to catch up. Give it a go. I am sure you can do it.

Question 1:**
 * __Challenge 1:__

using namespace std;
 * 1) include

int main(void){ int tables[10]={-1,0,1,2,3,4,5,6,7,8}; int i; int mxm=tables[0]; for(i=0;i<10;i++) { if(tables[i]>mxm) mxm=tables[i]; }

cout<<"Maximum number is: "<<mxm<<endl;

system("PAUSE"); return 0; }


 * Question 2:**

using namespace std;
 * 1) include

int main(void){ int tables[10]={-1,0,1,2,3,4,5,6,7,8}; int i; int mnm=tables[0]; for(i=0;i<10;i++) { if(tables[i]<mnm) mnm=tables[i]; }

cout<<"Minimum number is: "<<mnm<<endl; system("PAUSE"); return 0; }


 * Question 3:**

using namespace std;
 * 1) include

int main(void){ int tables[10]={-1,0,1,2,3,4,5,6,7,8}; int i; float sum=tables[0]; //when the numbers are divided by 10, there are decimals so i use float instead of int for(i=0;i<10;i++) { sum+=tables[i]; }

cout<<"Average is:"<>n; for (i=0;i<10;i++) { if (n==tables[i]) occurence++; } cout<<"\nThe number "<0;i--)// reverse order cout<<"Reverse order:"<< tables[i];

system("PAUSE"); return 0; }

__**Challenge 2:**__
 * 1) include

int main; using namespace std;

char arr[5]={'z','v','E','a','b'}; char store; int x; int y;

for(x=0;x<4;x++) { for (y=0;y<4-x;y++) { if(arr[y]>arr[y+1]) { arr[y+1]=store; arr[y]=arr[y+1]; arr[y]=store; } } } for(int x=0;x<=4;i++) { cout <<"Sorted alphabetical order is: "<<arr [x]<<endl; } system("PAUSE");

return 0; }