okay so like case 2 and 3 is not working, also the program is still not finish but why isn't case 2 and 3 not functioning well on the switch part? case 1 works just fine :/ please help!!!
Code:
#include<stdio.h>
main ()
{
//passcode part (passcode is 1234)
int passcode, choice, choice1;
char letter;
system("color 49");
printf("\n\n\n\n\n\t\t The passcode is a 4 - digit number.");
printf("\n\n\n\n\n\n\t\t\tEnter the PASSCODE >>> ");
scanf("%d", &passcode);
while(passcode != 1234)
{
system("cls");
printf("\n\n\n\n\n\t\tYou entered the wrong passcode! Please try again.");
printf("\n\n\n\n\n\n\t\t\tEnter the PASSCODE >>> ");
scanf("%d", &passcode);
}
system("cls");
printf("\n\n\n\n\n\n\t Congratulations, you have entered the right passcode.");
printf(" \n\n\n\n\n\tDo you still want to continue? Type [1] for yes and [2] for no >>> ");
scanf("%d", &choice);
if(choice == 1)
{
system("cls");
//da menu lol
printf("\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\t\t ****************************************");
printf("\n\n\t\t HEALTY FITNESS PROGRAM w/ MATH v.12");
printf("\n\n\t\t\t1. Information");
printf("\n\n\t\t\t2. Statistics");
printf("\n\n\t\t\t3. About the Creators");
printf("\n\n\t\t\t4. Fun, Special and Interesting!");
printf("\n\n\t\t\t5. Exit");
printf("\n\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\n\t\t\t Select a number >>> ");
scanf("%d", &choice1);
switch(choice1)
{
case 1:
system("cls");
printf("\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\n\t-+INFORMATION ABOUT THE PROGRAM");
printf("\n\nThis program is simply an array of statistical tools that calculates the set of values which is the health data of a student.");
printf("\n\n\t-+STATISTICAL TOOLS");
printf("\n\nThis program offers solving the mean, median, mode, range, standard deviation and percentiles of a health data of a student.");
printf("\n\n\t-+STATISTICS");
printf("\n\nThis is where all the calculations take place, the main purpose of the program.");
printf("\n\n\t-+ABOUT THE CREATORS");
printf("\n\nThis is where all the details on the creators of the program are placed, check \nit out!");
printf("\n\n\t-+FUN, SPECIAL AND INTERESTING!");
printf("\n\nThis is an extra part of the program, can burn your boredom to ashes thats why \nit has an exclamation mark on it.");
printf("\n\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\n\t\t Wanna go back? Type [Y] for yes or [N] for no. >>> ");
scanf("%s", &letter);
if(letter == 'y' || letter == 'Y')
main ();
else
system("cls");
printf("\n\n\n\n\n\n\t The program will now terminate... Thank you for using!\n\n\n\n\t\t\t Press any key now to close!");
break;
case 2:
printf("\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\n\t-+INFORMATION ABOUT THE PROGRAM");
printf("\n\nThis program is simply an array of statistical tools that calculates the set of values which is the health data of a student.");
break;
case 3:
printf("\n----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------");
printf("----------------------------------------------------------------------------------------");
printf("\n\nThis program is simply an array of statistical tools that calculates the set of values which is the health data of a student.");
break;
}
}
else
{
system("cls");
printf("\n\n\n\n\n\n\t The program will now terminate... Thank you for using!\n\n\n\n\t\t\t Press any key now to close!");
getch();
}
}