1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
#include <stdio.h>
struct StudentInfo {
int age, id;
char gender, sub_1,sub_2,sub_3,sub_4;
char name[40];
} s_tudent;
int main ()
{ int area, fee = 600;
char ComputerScience, Physics = 50, Math, Biology = 50, Chemistry = 50;
printf("-----------------------------------------------------------\n");
printf("Welcome to the Antigua State College Registration system.\n");
printf("-----------------------------------------------------------");
printf("\nPlease select your area of study <1>Humanities <2>Social Sciences <3>Sience and Technology:");
scanf("%d", &area);
while(area <= 3)
switch(area){
case 1: printf("\nWelcome, you have chosen Humanities!");
printf("\nPlease enter your identification:");
scanf("%d", &s_tudent.id);
printf("Please enter your name:");
scanf("%c", &s_tudent.name);
printf("Please enter your Gender:");
scanf("%c", &s_tudent.gender);
printf("Please enter your age:");
scanf("%d", &s_tudent.age);
printf("List of subjects:\n Food and Nutrition, French, History, Literature, Spanish, Art, Law, Sociology, Politics, Environmental Science.\n");
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_1);
printf("Choose a Subject:");
scanf("%c", &s_tudent.sub_2);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_3);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_4);
fee = fee;
break;
case 2: printf("\nWelcome, you have chosen Social Sciences!");
printf("\nPlease enter your identification:");
scanf("%d", &s_tudent.id);
printf("Please enter your name:");
scanf("%c", &s_tudent.name);
printf("Please enter your Gender:");
scanf("%c", &s_tudent.gender);
printf("Please enter your age:");
scanf("%d", &s_tudent.age);
printf("List of subjects:\n Accounting, Economics, Management of Business, Law, Politics, Sociology, Art, Math, EnvironmentalScience.\n");
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_1);
printf("Choose a Subject:");
scanf("%c", &s_tudent.sub_2);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_3);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_4);
fee = fee;
break;
case 3: printf("\nWelcome, you have chosen Science and Technology!");
printf("\nPlease enter your identification:");
scanf("%d", &s_tudent.id);
printf("Please enter your name:");
scanf("%c", &s_tudent.name);
printf("Please enter your Gender:");
scanf("%c", &s_tudent.gender);
printf("Please enter your age:");
scanf("%d", &s_tudent.age);
printf("List of subjects:\n Biology, Chemistry, ComputerScience, Geography, EnvironmentalScience, Math, Physics, I.T,Sociology, Art.\n");
printf("If you choose ComputerScience or Physics you must choose Math!\n");
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_1);
printf("Choose a Subject:");
scanf("%c", &s_tudent.sub_2);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_3);
printf("Choose a subject:");
scanf("%c", &s_tudent.sub_4);
fee = fee;
if(s_tudent.sub_1, s_tudent.sub_2, s_tudent.sub_3, s_tudent.sub_4 == ComputerScience || Physics)
if(s_tudent.sub_1, s_tudent.sub_2, s_tudent.sub_3, s_tudent.sub_4 != Math)
printf("You cannot do ComputerScience or Physics without math!");
if(s_tudent.sub_1 = Biology || Chemistry || Physics)
fee = fee + 50;
if(s_tudent.sub_2 = Biology || Chemistry || Physics)
fee = fee +50;
if(s_tudent.sub_3 = Biology || Chemistry || Physics)
fee = fee +50;
if(s_tudent.sub_4 = Biology || Chemistry || Physics)
fee = fee +50;
break;
}
printf("Registration is now complete!");
printf("Name: %s", &s_tudent.name);
printf("ID: %d", &s_tudent.id);
printf("Gender: %c", &s_tudent.gender);
printf("Age: %d", &s_tudent.age);
printf("Subjects: %c %c %c %c", &s_tudent.sub_1,&s_tudent.sub_2,&s_tudent.sub_3,&s_tudent.sub_4);
printf("Fee: %d", &fee);
printf("----------------------------------------------------------------------------------");
printf("Thank you for using the registration system.Goodbye");
getchar();
getchar();
return 0;
}
|