Advertisement
Guest User

Untitled

a guest
Jan 28th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <stdio.h>
  3. #include<string.h>
  4.  
  5.  
  6. int main()
  7. {
  8. char Username[20];
  9. char Password[20];
  10. char Name[100];
  11. int ID;
  12. char position[50];
  13. char NewUserName[20];
  14. char NewPassword[20];
  15. char LecturerName[100];
  16. char Department[100];
  17. char Durations[100];
  18. char Reason[100];
  19. char StartDate[50];
  20. char EndDate[50];
  21. char approval[10];
  22. FILE *fp;
  23. //*Login/
  24. int login = 0;
  25. printf("1.Login\n");
  26. printf("2.Sign up new member\n");
  27. printf("Please choose a login system:");
  28. scanf_s("%d", &login);
  29. switch (login)
  30. {
  31. case 1:
  32. //*Login/
  33. printf("Enter Username:");
  34. scanf_s("%s", &Username);
  35. printf("Enter Password:");
  36. scanf_s("%s", &Password);
  37. case 2:
  38. //*Sign up new Member/
  39. printf("Register new user\n");
  40. printf("Enter your name:");
  41. scanf_s("%s", &Name);
  42. printf("Enter ID:");
  43. scanf_s("%d", &ID);
  44. printf("Enter position:");
  45. scanf_s("%s", &position);
  46. printf("Enter department:");
  47. scanf_s("%s", &Department);
  48. printf("Enter New Username:");
  49. scanf_s("%s", &NewUserName);
  50. printf("Enter New Password:");
  51. scanf_s("%s", &NewPassword);
  52. default:
  53. printf("Invalid login.\n");
  54. }
  55. printf("Please proceed.\n");
  56. printf("\n*************************************\n");
  57.  
  58.  
  59. int services = 0;
  60. printf("1.Record leave.\n");
  61. printf("2.Approve leave.\n");
  62. printf("3.Display leave.\n");
  63. printf("4.Upload yearly leave.\n");
  64. printf("Please select a service:");
  65. scanf_s("%d",&services);
  66. switch (services)
  67. {
  68. case 1:
  69. //*Recording lecturer's leave/
  70. printf("***Recording lecturer's leave***");
  71. printf("Enter lecturer name:");
  72. scanf_s("%s",&LecturerName);
  73. printf("Enter ID:");
  74. scanf_s("%d",&ID);
  75. printf("Enter department:");
  76. scanf_s("%s",&Department);
  77. printf("Enter leave durations:");
  78. scanf_s("%s",&Durations);
  79. printf("Enter the reason for leave:");
  80. scanf_s("%s",&Reason);
  81. printf("From:");
  82. scanf_s("%s",&StartDate);
  83. printf("To:");
  84. scanf_s("%s",&EndDate);
  85. printf("Save File\n"); ;
  86. break;
  87. case 2:
  88. //*Approve lecturer's leave/
  89. printf("***Approving Lecturer's leave***");
  90. printf("Enter name:");
  91. scanf_s("%s",&LecturerName);
  92. printf("Approving leave.....");
  93. scanf_s("%s", &approval);
  94. if ("Acceptable.\n")
  95. {
  96. printf("Print leave application.\n");
  97. }
  98. else if ("Rejected.\n")
  99. {
  100. printf("Delete leave application.\n");
  101. };
  102. break;
  103. case 3:
  104. //*Display lecturer's leave/
  105. printf("***Display lecturer's leave***\n");
  106. printf("Enter name:");
  107. scanf_s("%s",LecturerName);
  108. printf("From:");
  109. scanf_s("%s",&StartDate);
  110. printf("To:");
  111. scanf_s("%s", &EndDate);
  112. break;
  113. case 4:
  114. //*Upload yearly leave/
  115. printf("***Upload yearly leave***\n");
  116. printf("Enter name:");
  117. scanf_s("%s",&LecturerName);
  118. printf("From:");
  119. scanf_s("%s",&StartDate);
  120. printf("To:");
  121. scanf_s("%s",&EndDate);
  122. break;
  123. default:
  124. printf("Invalid service.\n");
  125. };
  126.  
  127. return 0;
  128. fclose(fp);
  129.  
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement