Guest User

Untitled

a guest
Feb 26th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. //char password[15] = "L3tM3in";
  5. //char username[15] = "Admin19";
  6.  
  7. void login();
  8. void menu(int *option);
  9.  
  10. int main()
  11. {
  12. //login();
  13.  
  14.  
  15.  
  16. int option = 0;
  17. //while(option != 4){
  18. printf(" Drug Admin. System\n");
  19. printf("Menu:\n 1. Check Quantity\n 2.Refill\n 3.Dispense\n 4.Quit\n\nSelect Option:\n");
  20. scanf("%d", &option);
  21. menu(&option);
  22.  
  23. //}
  24.  
  25.  
  26. return 0;
  27.  
  28.  
  29.  
  30. }
  31. void menu(int *option){
  32.  
  33. int a = 40; //Amoxil
  34. int s = 40; //Synthroid
  35. int z = 30;//Zestril
  36. int v = 10;//Vicodin
  37.  
  38. switch(*option){
  39. case(1):
  40. system("@cls||clear");
  41. printf(" Current Quantities\n");
  42. printf("Amoxid %d\nSynthroid %d\nZestril %d\nVicodin %d\n", a, s, z, v);
  43. getchar();
  44. char pick;
  45. int i;
  46. if()
  47. pick = getchar();
  48. printf("Return to menu press b:\n");
  49.  
  50.  
  51. }
  52.  
  53. /*printf("%d", *option);
  54. if(*option == 1){
  55. system("@cls||clear");
  56. printf("Amoxil %d\nSynthroid %d\nZestril %d\nVicodin %d\n\n", a, s, z, v);
  57. getchar();
  58. char pick;
  59. do{
  60. printf("Return to menu press b: \n");
  61. pick = getchar();
  62. getchar();
  63.  
  64.  
  65.  
  66. }while(pick != 'b');
  67. while(pick == 'b'){
  68. break;
  69. }
  70.  
  71.  
  72.  
  73. }
  74. else if(*option == 2){
  75.  
  76.  
  77. }else if(*option == 3){
  78.  
  79.  
  80. }
  81. else{
  82.  
  83. printf("Quit Program\n");
  84.  
  85.  
  86. } */
  87.  
  88.  
  89. }
  90.  
  91.  
  92.  
  93.  
  94. void login(){
  95. char username[15] = "test";
  96. char password[15] = "test";
  97. char username1;
  98. char password1;
  99.  
  100. int nameCorrect = 1;
  101. int passCorrect = 1;
  102. int i = 0;
  103. int j = 0;
  104.  
  105. int size = 4;
  106. do{
  107.  
  108. nameCorrect = 1;
  109. passCorrect = 1;
  110. i = 0;
  111. printf("Enter username:");
  112. username1 = getchar();
  113. while(username1 != '\n'){
  114. if(username[i] != username1){
  115. nameCorrect = 0;
  116. printf("no");
  117.  
  118. }
  119. i++;
  120. username1 = getchar();
  121.  
  122. }
  123. j = 0;
  124. printf("Enter Password:");
  125. password1 = getchar();
  126. while(password1 !='\n'){
  127. if(password[j] != password1){
  128. passCorrect = 0;
  129.  
  130. }
  131. j++;
  132. password1 = getchar();
  133.  
  134. }
  135.  
  136. system("@cls||clear");
  137.  
  138.  
  139. }
  140. while(((nameCorrect != 1) || (passCorrect != 1)) || i != size || j != size);
  141.  
  142.  
  143. }
Add Comment
Please, Sign In to add comment