Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- char *registeredClientDatabase[50][12];
- char *pendingClientDatabase[50][2];
- void adminLogin();
- void clientRegister();
- int main(int argc, char *argv[]){
- char selection[50];
- char action[50];
- int i, j;
- for(i = 0; i < 50; i++)
- {
- for(j = 0; j < 12; j++)
- {
- registeredClientDatabase[i][j] = "null";
- }
- }
- for(i = 0; i < 50; i++)
- {
- for(j = 0; j < 2; j++)
- {
- pendingClientDatabase[i][j] = "null";
- }
- }
- do
- {
- printf("Welcome to the Home Screen");
- do
- {
- printf("What would you like to log in as?\n");
- printf("Please type 'Admin' to log in as an admin: \n");
- printf("Please type 'Client' to log in as a client: \n");
- }
- while((strcmp(selection, "Admin") != 0) || (strcmp(selection, "Client") != 0));
- if(strcmp(selection, "Admin") == 0)
- {
- printf("Welcome to the admins' login screen: \n");
- adminLogin();
- do
- {
- }
- while(strcmp(action, "Exit") != 0);
- }
- else
- {
- printf("Welcome to the clients' login screen: \n");
- char clientAction[50];
- do
- {
- printf("Would you like to Login or Register? \n");
- printf("Please type 'Login' to login: \n");
- printf("Please type 'Register' to register: \n");
- scanf(" %s", clientAction);
- }
- while((strcmp(clientAction, "Login") != 0) || (strcmp(clientAction, "Register") != 0));
- if(strcmp(clientAction, "Register") == 0)
- {
- }
- }
- }
- while(strcmp(action, "Exit") != 0);
- return 0;
- }
- void AdminLogin()
- {
- char username[50];
- char password[50];
- do
- {
- printf("Please provide the admin's username: \n");
- scanf(" %s", username);
- }
- while(strcmp(username, "admin") != 0);
- do
- {
- printf("Please provide the admin's password: \n");
- scanf(" %s, password");
- }
- while(strcmp(password, "pizza") != 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement