/*Hjh Fatini Auni binti Hj Anuar Puasa

/*Hjh Fatini Auni binti Hj Anuar Puasa (B20171065) from EEE*/

#include
#include
#include
#include
#include

int SubCalMenu();
int SubGuessMenu();
int SubMagicMenu();
int SubConMenu();
int SubSPCMenu();

int main()
{
while(1)
{
char x;
printf(“\nPlease select one of the following options by entering the number: \n\n”);
printf(“1. Calculation \n”);
printf(“2. Guess A Number \n”);
printf(“3. Magic Square \n”);
printf(“4. Conversion \n”);
printf(“5. Scrabble Points Calculator \n”);
printf(“0. Quit \n\n”);
scanf(” %c”, &x);

switch(x)
{
case ‘1’ : SubCalMenu();
break;
case ‘2’ : SubGuessMenu();
break;
case ‘3’ : SubMagicMenu();
break;
case ‘4’ : SubConMenu();
break;
case ‘5’ : SubSPCMenu();
break;
case ‘0’ : printf(“Quit\n”);
return 0;
break;
default : printf(“Invalid. Please try again.”);
break;
}
}
}

/*Calculation*/
int SubCalMenu()
{
char y;

printf(“Select one of the following calculations by entering the letter: \n”);
printf(“a. Addition \n”);
printf(“b. Subtraction \n”);
printf(“c. Division \n”);
printf(“d. Multiplication \n”);
printf(“e. Roots of quadratic equation \n\n”);
scanf(” %c”, &y);

if(y==’a’)
{
int n, i, value, sum = 0;
float average;

printf(“Enter how many numbers you want to add: “);
scanf(“%d”, &n);

printf(“Enter %d numbers: \n”, n);
for(i=0; i