Advertisement
deathkostis

Untitled

Jan 4th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. char *registeredClientDatabase[50][12];
  6. char *pendingClientDatabase[50][2];
  7.  
  8. void adminLogin();
  9. void clientRegister();
  10.  
  11. int main(int argc, char *argv[]){
  12.  
  13. char selection[50];
  14.  
  15. char action[50];
  16. int i, j;
  17.  
  18. for(i = 0; i < 50; i++)
  19. {
  20. for(j = 0; j < 12; j++)
  21. {
  22. registeredClientDatabase[i][j] = "null";
  23. }
  24. }
  25.  
  26. for(i = 0; i < 50; i++)
  27. {
  28. for(j = 0; j < 2; j++)
  29. {
  30. pendingClientDatabase[i][j] = "null";
  31. }
  32. }
  33.  
  34. do
  35. {
  36.  
  37. printf("Welcome to the Home Screen");
  38.  
  39. do
  40. {
  41. printf("What would you like to log in as?\n");
  42. printf("Please type 'Admin' to log in as an admin: \n");
  43. printf("Please type 'Client' to log in as a client: \n");
  44. }
  45. while((strcmp(selection, "Admin") != 0) || (strcmp(selection, "Client") != 0));
  46.  
  47. if(strcmp(selection, "Admin") == 0)
  48. {
  49. printf("Welcome to the admins' login screen: \n");
  50.  
  51. adminLogin();
  52.  
  53. do
  54. {
  55.  
  56. }
  57. while(strcmp(action, "Exit") != 0);
  58. }
  59. else
  60. {
  61. printf("Welcome to the clients' login screen: \n");
  62.  
  63. char clientAction[50];
  64.  
  65. do
  66. {
  67. printf("Would you like to Login or Register? \n");
  68. printf("Please type 'Login' to login: \n");
  69. printf("Please type 'Register' to register: \n");
  70. scanf(" %s", clientAction);
  71. }
  72. while((strcmp(clientAction, "Login") != 0) || (strcmp(clientAction, "Register") != 0));
  73.  
  74. if(strcmp(clientAction, "Register") == 0)
  75. {
  76.  
  77. }
  78.  
  79. }
  80. }
  81. while(strcmp(action, "Exit") != 0);
  82.  
  83. return 0;
  84. }
  85.  
  86. void AdminLogin()
  87. {
  88. char username[50];
  89. char password[50];
  90.  
  91. do
  92. {
  93. printf("Please provide the admin's username: \n");
  94. scanf(" %s", username);
  95. }
  96. while(strcmp(username, "admin") != 0);
  97.  
  98. do
  99. {
  100. printf("Please provide the admin's password: \n");
  101. scanf(" %s, password");
  102. }
  103. while(strcmp(password, "pizza") != 0);
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement