Advertisement
Guest User

code

a guest
Jan 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.38 KB | None | 0 0
  1. //The username and the pass for the admin are admin 12321
  2. #include <stdio.h>
  3. void payment(WIP)
  4. {
  5. //it's gonna print the payment info for a student chosen by the administrator
  6. }
  7. void modify(WIP)
  8. {
  9. //it's gonna modify the array without returning anything
  10. }
  11. void delete(WIP)
  12. {
  13. //it's gonna modify the array without returning anything
  14. }
  15. void assessmentteacher(WIP)
  16. {
  17. //prints the assessment and returns nothing
  18. }
  19. void assessmentstuden(WIP)
  20. {
  21. //prints the assessment and returns nothing
  22. }
  23. void add(WIP)
  24. {
  25. //WIP
  26. }
  27. int searchstudent(char studentname[]) WIP
  28. {
  29. //it's gonna return the address
  30. }
  31. int searchteacher(WIP)
  32. {
  33. //it's gonna return the address
  34. }
  35. void login(char user[100], char pass[100])
  36. {
  37. while (1)
  38. {
  39. printf("Please enter your username:\n");
  40. scanf("%s", user);
  41. if(user != 'admin')
  42. {
  43. printf("Invalid Username.\n");
  44. continue;
  45. }
  46. else if(user == 'admin')
  47. {
  48. break;
  49. }
  50. }
  51. while(1)
  52. {
  53. printf("\nPlease enter your password:\n");
  54. scanf("%s", pass);
  55. if(pass != '12321')
  56. {
  57. printf("Invalid Password!\n");
  58. continue;
  59. }
  60. else if(pass == '12321')
  61. {
  62. admin();
  63. }
  64. }
  65. }
  66. void admin(char SName[1][100], int SInfo[4][100], int TName[][], int TInfop[][]) WIP
  67. {
  68. int choice; char delchoice = 'a'; char search = 'a'; char searchagain = 'a'; char assessment = 'a';
  69. char assessmentagain = 'a'; char paymentchoice = 'a';
  70. printf("What would you like to do?\n1- Add/Modify/Delete data.\n2- Search for a student or a teacher.\n3- Print assessment report for teacher/student.\n4- Print the payment info of a student.\n");
  71. scanf("%d", &choice");
  72. if(choice == 1)
  73. {
  74. printf("\nWhat would you like to do? (A/D/M)\n");
  75. scanf("\n%c", &delchoice);
  76. if(delchoice == 'A' || delchoice == 'a')
  77. {
  78. add(WIP);
  79. }
  80. else if(delchoice == 'M' || delchoice == 'm')
  81. {
  82. modify(WIP);
  83. }
  84. else if(delchoice == 'D' || delchoice == 'd')
  85. {
  86. delete(WIP);
  87. }
  88. }
  89. else if(choice == 2)
  90. {
  91. do
  92. {
  93. printf("\nWhat would you like to search for? (S/T)\n");
  94. scanf("\n%c", &search);
  95. if(search == 'S' || search == 's')
  96. {
  97. searchstudent(WIP);
  98. }
  99. else if(search == 'T' || search == 't')
  100. {
  101. searchteacher(WIP);
  102. }
  103. printf("\nWould you like to search for anything else? (Y/N)\n");
  104. scanf("\n%c", &searchagain);
  105. }
  106. while(searchagain == 'Y' || searchagain == 'y');
  107. }
  108. else if(choice == 3)
  109. {
  110. do
  111. {
  112. printf("\nWho would you like to print the assessment for? (S/T)\n");
  113. scanf("\n%c", &assessment);
  114. if(assessment == 'S' || assessment == 's')
  115. {
  116. assessmentstuden(WIP);
  117. }
  118. else if(assessment == 'T' || assessment == 't')
  119. {
  120. assessmentteacher(WIP);
  121. }
  122. printf("\nWould you like to print another assessment? (Y/N)\n");
  123. scanf("\n%c", &assessmentagain);
  124. }
  125. while(assessmentagain == 'y' || assessmentagain 'Y');
  126. }
  127. else if(choice == 4)
  128. {
  129. do
  130. {
  131. payment(WIP);
  132. printf("\nWould you like to print the payment info for another student? (Y/N)\n");
  133. scanf("\n%c", &paymentchoice);
  134. }
  135. while(paymentchoice == 'Y' || paymentchoice == 'y');
  136. }
  137. }
  138. int main() //The arrays are WIPs
  139. {
  140. char RegCheck = 'a'; char Username; int CUser = 0; int password; int addresstemp;
  141. char user[100]; char pass[100];
  142. char SName[1][100]; int SInfo[4][100];
  143. login(user, pass);
  144. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement