Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- SUBJECT : COMPUTER SCIENCE UNIT 2
- PROGRAM : INVENTORY & POINT OF SALE SYSTEM
- */
- #include <stdio.h>
- #include <string.h>
- #include <unistd.h>
- #include <stdlib.h>
- #include <time.h>
- #define minlength 5
- /*VARIABLES*/
- int x,y,z,a,b,choice,admit,idno,workerCNT;
- int itemCNT;
- int posCNT;
- char container[255];
- float floatcontainer;
- int currentlogin;
- char user[15];
- char username[10];
- char password[20];
- char adminusername[10] = "Admin";
- char adminpassword[20] = "password";
- char confirmpassword[20];
- char testpassword[20];
- int strlen1;
- int strlen2;
- char remitemname[100];
- struct employee{
- char username[10][100];
- char password[10][100];
- char fname[15][100];
- char mname[15][100];
- char lname[15][100];
- char dob[15][100];
- int gender;
- int male[100];
- int female[100];
- char deleteID[12];
- }record;
- struct stockpile{
- char itemname[10000][20];
- float stock[10000];
- float sp[10000];
- float bp[10000];
- float sold[1000];
- float spoiltquantity[10000];
- float spoiltloss[10000];
- float profit_loss[10000];
- float price;
- float networth;
- float asset;
- float assetloop[10000];
- float totalprofit;
- }inventory;
- struct cashregister{
- char itemname[1000][20];
- float quantity[1000];
- float price[1000];
- float sp[1000];
- float pricenotax;
- float tax;
- int transaction;
- float subtotal;
- float total;
- float cashtendered;
- float change;
- float subloop;
- }pos;
- char workusername[10][1000];
- /*FUNCTION TO ADD ITEMS TO THE INVENTORY*/
- void additem()
- {
- choice=0;
- while(choice != 2)
- {
- x=itemCNT;
- printf("\n\n");
- printf("Enter the name of the item: ");
- scanf("%s", container);
- for (a=0;a<itemCNT;a++)
- {
- if (strcmp(container,inventory.itemname[a]) == 0)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- printf("\n\n");
- printf("THAT ITEM HAS ALREADY BEEN USED. NO DUPLICATE ITEMNAMES IN THE INVENTORY...");
- sleep(3);
- }
- else
- {
- strcpy(inventory.itemname[x],container);
- printf("Enter the quantity: ");
- scanf("%f", &inventory.stock[x]);
- printf("Enter the price bought: ");
- scanf("%f", &inventory.bp[x]);
- printf("Enter the price to be sold: ");
- scanf("%f", &inventory.sp[x]);
- x++;
- itemCNT++;
- inventory.networth = inventory.bp[x] * inventory.stock[x];
- printf("\nItem successfully added. Add another? Enter '1' for yes and '2' for no: ");
- scanf("%d", &choice);
- if (choice == 2)
- {
- choice = 0;
- break;
- }
- }
- }
- }
- /*FUNTION TO EDIT ITEM IN THE INVENTORY*/
- void edititem()
- {
- printf("\n\n\n\n\n");
- printf("***********************************************************************************************************************************************************************\n");
- printf("| ID# | ITEM | STOCK | BUYING PRICE | SELLING PRICE | SOLD | SPOILT QNTY | SPOILT LOSS | PROFIT/LOSS |\n");
- printf("***********************************************************************************************************************************************************************\n\n");
- printf("%4d", a);
- printf("%26s", inventory.itemname[a]);
- printf("%15.1f", inventory.stock[a]);
- printf("%15.2f", inventory.bp[a]);
- printf("%17.2f", inventory.sp[a]);
- printf("%16.1f", inventory.sold[a]);
- printf("%17.1f", inventory.spoiltquantity[a]);
- printf("%19.2f", inventory.spoiltloss[a]);
- printf("%29.2f", inventory.profit_loss[a]);
- while (choice != 6)
- {
- printf("\n\n\n\n\n\n\n");
- printf("Edit what about the item: \n\n");
- printf(" 1] Name\n");
- printf(" 2] Buying price\n");
- printf(" 3] Selling price\n");
- printf(" 4] Stock\n");
- printf(" 5] Amount Sold\n");
- printf(" 6] Exit\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- printf("\n\n\n\n");
- if (choice == 6)
- {
- choice == 0;
- break;
- }
- if (choice == 1)
- {
- printf("ENTER NEW ITEM NAME: ");
- scanf("%s", inventory.itemname[a]);
- printf("\n\n");
- printf("SUCCESSFUL");
- sleep(3);
- }
- if (choice == 2)
- {
- printf("ENTER NEW BUYING PRICE: ");
- scanf("%f", &inventory.bp[a]);
- printf("\n\n");
- printf("SUCCESSFUL");
- sleep(3);
- }
- if (choice == 3)
- {
- printf("ENTER NEW SELLING PRICE: ");
- scanf("%f", &inventory.sp[a]);
- printf("\n\n");
- printf("SUCCESSFUL");
- sleep(3);
- }
- if (choice == 4)
- {
- printf("ENTER NEW STOCK: ");
- scanf("%s", inventory.stock[a]);
- printf("\n\n");
- printf("SUCCESSFUL");
- sleep(3);
- }
- if (choice == 5)
- {
- printf("ENTER NEW AMOUNT SOLD: ");
- scanf("%s", inventory.sold[a]);
- printf("\n\n");
- printf("SUCCESSFUL");
- sleep(3);
- }
- }
- }
- /*FUNCTION TO PRINT INVENTORY IN THE MAIN FUNCTION*/
- void inventoryprint()
- {
- printf("\n\n\n\n\n");
- printf("***********************************************************************************************************************************************************************\n");
- printf("| ID# | ITEM | STOCK | BUYING PRICE | SELLING PRICE | SOLD | SPOILT QNTY | SPOILT LOSS | PROFIT/LOSS |\n");
- printf("***********************************************************************************************************************************************************************\n\n");
- for(y=0;y<itemCNT;y++)
- {
- printf("%4d", y);
- printf("%26s", inventory.itemname[y]);
- printf("%15.1f", inventory.stock[y]);
- printf("%15.2f", inventory.bp[y]);
- printf("%17.2f", inventory.sp[y]);
- printf("%16.1f", inventory.sold[y]);
- printf("%17.1f", inventory.spoiltquantity[y]);
- printf("%19.2f", inventory.spoiltloss[y] = inventory.spoiltquantity[y]*inventory.bp[y]);
- printf("%29.2f", inventory.profit_loss[y] = ((inventory.sp[y]-inventory.bp[y])*inventory.sold[y]) - inventory.spoiltloss[y]);
- printf("\n\n");
- }
- inventory.asset = 0;
- inventory.networth = 0;
- inventory.totalprofit = 0;
- for (a=0;a<itemCNT;a++)
- {
- inventory.totalprofit = inventory.totalprofit + inventory.profit_loss[a];
- inventory.assetloop[a] = (inventory.bp[a]*inventory.stock[a]);
- inventory.asset = inventory.asset + inventory.assetloop[a];
- }
- inventory.networth = (inventory.asset + inventory.totalprofit);
- printf("\n\n\n\nTOTAL PROFIT = $");
- printf("%.2f", inventory.totalprofit);
- printf("\n\nTOTAL ASSETS = $");
- printf("%.2f", inventory.asset);
- printf("\n\nNET WORTH = $");
- printf("%.2f", inventory.networth);
- printf("\n\n\n\n\n");
- }
- /*MAIN FUNCTION*/
- int main()
- {
- x=0;
- /*INITIAL SETUP UPON FIRST USE*/
- printf("*****\n");
- printf ("SETUP\n");
- printf("*****\n\n");
- printf(" ENTER ADMIN ID: ");
- scanf("%s", adminusername);
- printf("\n");
- strlen1=strlen(adminusername);
- printf(" ENTER ADMIN PASSWORD: ");
- scanf("%s", adminpassword);
- printf("\n");
- strlen2=strlen(adminpassword);
- printf(" CONFIRM ADMIN PASSWORD: ");
- scanf("%s", confirmpassword);
- while (strlen1 < minlength || strlen2 < minlength || strcmp(adminpassword,confirmpassword) != 0)
- {
- printf("\n\n\n");
- while (strlen1 < minlength)
- {
- printf(" THE ADMIN ID IS TOO SHORT..\n");
- printf(" RE-ENTER: ");
- scanf("%s", adminusername);
- printf("\n\n");
- strlen1=strlen(adminusername);
- }
- while (strlen2 < minlength)
- {
- printf(" THE PASSWORD LENGTH IS TOO SHORT..\n");
- printf(" RE-ENTER: ");
- scanf("%s", adminpassword);
- printf("\n\n");
- strlen2=strlen(adminpassword);
- printf(" ENTER CONFIRMATION PASSWORD: ");
- scanf("%s", confirmpassword);
- }
- if (strcmp(adminpassword,confirmpassword) != 0)
- {
- printf("\n\n");
- printf(" THE PASSWORD AND CONFIRMATION PASSWORD DO NOT MATCH..\n\n");
- sleep(2);
- printf(" RE-ENTER PASSWORD: ");
- scanf("%s", adminpassword);
- printf("\n\n");
- strlen2=strlen(adminpassword);
- printf(" ENTER CONFIRMATION PASSWORD: ");
- scanf("%s", confirmpassword);
- }
- }
- printf("\n\n\n");
- printf("**************\n");
- printf("SETUP COMPLETE\n");
- printf("**************\n\n\n");
- sleep(3);
- printf("This program is optimized for Fullscreen mode.\n Press 'alt + enter' to go Fullscreen.\n\n\n");
- sleep(2);
- printf("Program will now load. Please be patient..");
- sleep(3);
- /*LOGIN SEGMENT*/
- while (choice != 100)
- {
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- printf("This program is optimized for Fullscreen mode.\n Press 'alt + enter' to go Fullscreen.\n\n\n\n");
- printf("************\n");
- printf(" LOGIN\n");
- printf("************\n\n");
- printf("LOGIN AS: \n");
- printf("\n");
- printf(" 1] EMPLOYEE\n");
- printf(" 2] ADMIN\n\n");
- printf(" 100] SHUT DOWN\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- if (choice == 100)
- {
- printf("\n\n\n\n");
- sleep(2);
- printf("Saving Changes.");
- sleep(1);
- printf(".");
- sleep(1);
- printf(".");
- sleep(4);
- printf("\nShutting Down.");
- sleep(2);
- printf(".");
- sleep(2);
- printf(".");
- sleep(2);
- printf(".");
- sleep(3);
- printf("\n");
- }
- if (choice == 2)
- {
- printf("\n\n\n");
- sleep(1);
- printf("ENTER THE ADMIN PASSWORD TO ACCESS: ");
- scanf("%s", testpassword);
- if (strcmp(testpassword,adminpassword) != 0)
- {
- printf("\n\n\n");
- printf("********************\n");
- printf("ADMIN LOGIN DETECTED\n");
- printf("********************\n\n");
- printf("now logging attempt");
- sleep(1);
- printf(".");
- sleep(1);
- printf(".");
- sleep(1);
- printf(".\n\n\n");
- sleep(2);
- printf("PASSWORD INCORRECT\nresetting..");
- sleep(3);
- }
- if (strcmp(testpassword,adminpassword) == 0)
- {
- while (choice != 8)
- {
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- choice=0;
- printf ("\n\n\n\nADMINISTRATOR MENU\n\n");
- printf (" 1] Display Inventory\n");
- printf (" 2] Edit Inventory\n");
- printf (" 3] Add Employee Record\n");
- printf (" 4] Remove Employee Record\n");
- printf (" 5] List Employee Records\n");
- printf (" 6] Change Admin ID\n");
- printf (" 7] Change Admin password\n");
- printf (" 8] Exit Admin Mode\n\n");
- printf ("Choice: ");
- scanf ("%d", &choice);
- printf ("\n\n");
- if (choice == 1)
- {
- choice=0;
- if(itemCNT == 0)
- {
- printf("\n\n No items to display...");
- sleep(3);
- }
- else
- {
- inventoryprint();
- printf("\n\n\n\n\n");
- printf("\n\n\n\n\n\n\n\n\n\n\nEnter anything to exit..");
- char input[1];
- scanf("%s",input);
- if (strcmp(input,"") == 0)
- break;
- }
- }
- if (choice == 2)
- {
- choice = 0;
- while (choice != 5)
- {
- inventoryprint();
- printf("\n\n\n\n");
- printf("What would you like to do: \n\n");
- printf(" 1] Add item\n");
- printf(" 2] Remove item\n");
- printf(" 3] Edit an item\n");
- printf(" 4] Change Tax Rate\n");
- printf(" 5] Exit\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- printf("\n\n\n");
- /*TO EXIT*/
- if (choice == 5)
- {
- choice = 0;
- break;
- }
- if (choice == 4)
- {
- printf("\n\n");
- printf("Enter new tax rate (eg: '0.165'): ");
- scanf("%f", &pos.tax);
- printf("\nSUCCESSFUL");
- sleep(2);
- }
- /*TO ADD ITEM*/
- if (choice == 1)
- {
- additem();
- }
- /*TO REMOVE ITEM*/
- if (choice == 2)
- {
- while (choice != 3)
- {
- printf("What would you like to do: \n\n");
- printf(" 1] Lessen Item Quantity\n");
- printf(" 2] Complete Item Removal\n");
- printf(" 3] Exit\n\n");
- printf ("Choice: ");
- scanf("%d", &choice);
- /*TO EDIT ITEM*/
- if (choice == 3)
- {
- choice = 0;
- break;
- }
- else
- {
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- /*TO LESSEN ITEM QUANTITY*/
- if (choice == 1)
- {
- while(choice != 2)
- {
- inventoryprint();
- if (choice == 1)
- {
- while(choice == 1)
- {
- printf("ENTER ID# OF THE ITEM TO LESSEN THE QUANTITY OF: ");
- scanf("%d", &b);
- for(a=0;a<x;a++)
- {
- if(a == b)
- {
- admit = 1;
- y=a;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- inventoryprint();
- printf("\n\n\n\n");
- printf("Lower the stock quantity by: ");
- scanf("%f", &floatcontainer);
- printf("\n\n\n");
- printf("Pass this item as spoilt: \n\n");
- printf(" 1] Yes\n");
- printf(" 2] No\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- if (choice==1)
- {
- inventory.spoiltquantity[a] = inventory.spoiltquantity[a] + floatcontainer;
- }
- inventory.stock[a] = inventory.stock[a] - floatcontainer;
- inventory.profit_loss[a] = ((inventory.sp[a]-inventory.bp[a])*inventory.sold[a]) - inventory.spoiltloss[a];
- printf("\n\n\n\n\n");
- printf("OK.\n");
- sleep(3);
- }
- else
- {
- printf("\n\n\n\n");
- printf("ITEM NOT FOUND..");
- sleep(3);
- printf("\n\n\n");
- }
- printf("\n\n\n\n\n");
- printf("Continue? Enter '1' for yes and '2' for no: ");
- scanf("%d", &choice);
- printf("\n\n\n\n\n\n\n\n\n");
- if (choice == 2)
- {
- printf("resetting..\n\n\n\n\n");
- sleep(2);
- break;
- }
- }
- }
- if (choice == 2)
- {
- choice = 0;
- break;
- }
- }
- }
- /*TO WIPE ITEM FROM DATABASE*/
- if (choice == 2)
- {
- inventoryprint();
- choice = 0;
- while (choice != 2)
- {
- printf("ENTER THE ID# OF THE ITEM TO REMOVE: ");
- scanf("%d", &b);
- for(a=0;a<x;a++)
- {
- if(a == b)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- inventory.stock[a]=0;
- inventory.bp[a]=0;
- inventory.sp[a]=0;
- inventory.sold[a]=0;
- inventory.spoiltquantity[a]=0;
- strcpy(inventory.itemname[a],"\0");
- inventory.spoiltloss[a]=0;
- inventory.profit_loss[a]=0;
- /*LOOP RESULTING THE THE REMOVAL OF THE ITEM RECORD*/
- for (b=a;b<y;b++)
- {
- strcpy(inventory.itemname[b],"\n");
- inventory.bp[b] = inventory.bp[b+1];
- inventory.sp[b] = inventory.sp[b+1];
- inventory.sold[b] = inventory.sold[b+1];
- inventory.spoiltquantity[b] = inventory.spoiltquantity[b+1];
- inventory.spoiltloss[b] = inventory.spoiltloss[b+1];
- inventory.profit_loss[b] = inventory.profit_loss[b+1];
- }
- itemCNT--;
- printf("\n\n\n\n\n");
- printf("ITEM SUCCESSFULLY REMOVED.\n");
- sleep(3);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- }
- else
- {
- printf("\n\n\n\n");
- printf("ITEM NOT FOUND..");
- sleep(3);
- }
- printf("\n\n\n\n\n");
- printf("Continue? Enter '1' for yes and '2' for no: ");
- scanf("%d", &choice);
- printf("\n\n\n\n\n\n\n\n\n");
- if (choice == 2)
- {
- choice = 0;
- printf("resetting..\n");
- sleep(2);
- break;
- }
- }
- }
- }
- }
- }
- /*TO EDIT ITEM*/
- if (choice == 3)
- {
- choice = 0;
- while (choice != 3)
- {
- printf("\n\n\n");
- printf("Edit item by: \n\n");
- printf(" 1] Name\n");
- printf(" 2] ID#\n");
- printf(" 3] Exit\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- /*TO EXIT THE LOOP*/
- if (choice == 3)
- {
- choice = 0;
- break;
- }
- /*EDITING ITEM BY NAME*/
- if (choice == 1)
- {
- printf("ENTER THE NAME OF THE ITEM: ");
- scanf("%s", container);
- for (a=0;a<itemCNT;a++)
- {
- if (strcmp(container,inventory.itemname[a]) == 0)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- edititem();
- }
- else
- {
- printf("ITEM NOT FOUND...");
- sleep(3);
- printf("\n\n\n\n\n\n\n");
- }
- }
- /*EDITING ITEM BY ID#*/
- if (choice == 2)
- {
- printf("ENTER THE ID# OF THE ITEM: ");
- scanf("%d", &idno);
- for (a=0;a<itemCNT;a++)
- {
- if (idno==a)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- edititem();
- }
- else
- {
- printf("ITEM NOT FOUND...");
- sleep(3);
- printf("\n\n\n\n\n\n\n");
- }
- }
- }
- }
- }
- }
- if (choice == 3)
- {
- if (workerCNT == 99)
- {
- printf("EMPLOYEE DATABASE IS FULL, DELETE A RECORD TO CONTINUE.");
- sleep(2);
- printf("resetting..");
- sleep(3);
- break;
- }
- printf("\n\n");
- printf("ENTER EMPLOYEE ID: ");
- scanf("%s", container);
- for (x=0;x<workerCNT;x++)
- {
- if (strcmp(container,record.username[x]) == 0)
- {
- admit =1;
- break;
- }
- else
- admit=0;
- }
- if (admit == 1)
- {
- printf("THAT ID IS ALREADY USED, CANNOT CREATE DUPLICATE IDENTIIERS..");
- sleep(2);
- printf("\n\n");
- printf("TERMINATING..");
- sleep(2);
- break;
- }
- else
- strcpy(record.username[workerCNT],container);
- printf("ENTER EMPLOYEE PASSWORD: ");
- scanf("%s", record.password[workerCNT]);
- while (strlen(record.password[workerCNT]) > 8)
- {
- printf("\n\n");
- printf("PASSWORD EXCEEDES MAX, ENTER SHORTER PASSWORD: ");
- scanf("%s", record.password[workerCNT]);
- }
- printf("\n\n");
- printf(" ENTER EMPLOYEE FIRST NAME: ");
- scanf("%s", record.fname[workerCNT]);
- printf("\n");
- printf(" ENTER EMPLOYEE MIDDLE NAME: ");
- scanf("%s", record.mname[workerCNT]);
- printf("\n");
- printf(" ENTER EMPLOYEE LAST NAME: ");
- scanf("%s", record.lname[workerCNT]);
- printf("\n\n");
- printf(" ENTER EMPLOYEE D.O.B (dd/mm/yyyy): ");
- scanf("%s", record.dob[workerCNT]);
- printf("\n WHAT IS THE EMPLOYEE's GENDER: \n");
- printf(" 1] MALE\n");
- printf(" 2] FEMALE\n\n");
- printf(" Choice: ");
- scanf("%d", &record.gender);
- if (record.gender != 2)
- {
- record.male[workerCNT] = 1;
- record.female[workerCNT] = 0;
- }
- if (record.gender == 2)
- {
- record.male[workerCNT] = 0;
- record.female[workerCNT] = 1;
- }
- //<-- WORK HERE
- //<-- WORK HEEE
- //<-- WORK HEEE
- workerCNT++;
- printf("\n\n\n\n");
- printf("EMPLOYEE SUCCESSFULLY ADDED.");
- sleep(3);
- }
- if (choice == 4)
- {
- printf("\n\n");
- printf("ENTER EMPLOYEE ID TO REMOVE: ");
- scanf("%s", record.deleteID);
- for (x=0;x<100;x++)
- {
- if (strcmp(record.deleteID,record.username[x]) == 0)
- {
- admit = 1;
- y=x;
- break;
- }
- else
- {
- admit = 0;
- }
- }
- if (admit == 1)
- {
- strcpy(record.username[x],"\0");
- strcpy(record.password[x],"\0");
- strcpy(record.fname[x],"\0");
- strcpy(record.mname[x],"\0");
- strcpy(record.lname[x],"\0");
- strcpy(record.dob[x],"\0");
- for (x=y;x<workerCNT-1;x++)
- {
- strcpy(record.username[x],record.username[x+1]);
- strcpy(record.password[x],record.password[x+1]);
- strcpy(record.fname[x],record.fname[x+1]);
- strcpy(record.mname[x],record.mname[x+1]);
- strcpy(record.lname[x],record.lname[x+1]);
- strcpy(record.dob[x],record.dob[x+1]);
- record.male[x] = record.male[x+1];
- record.female[x] = record.female[x+1];
- }//<-- WORk ON HERE< LOOP TO REMOVE EMPLOYEE
- printf("*****************************\n");
- printf("EMPLOYEE SUCCESSFULLY REMOVED\n");
- printf("*****************************\n\n");
- workerCNT--;
- sleep(3);
- }
- else
- {
- printf("ID WAS NOT FOUND IN THE DATABASE.\nresetting..");
- sleep(3);
- }
- }
- /*TO LIST EMPLOYEE RECORDS*/
- if (choice == 5)
- {
- while (choice != 3)
- {
- printf("\n\n\n");
- printf("***********************************************************************************************************************************************************************\n");
- printf("| LIST# FIRSTNAME MIDDLENAME LASTNAME PASSWORD DOB MALE FEMALE ID |\n");
- printf("***********************************************************************************************************************************************************************\n\n");
- for (x=0;x<workerCNT;x++)
- {
- printf("%6d", x);
- printf("%19s", record.fname[x]);
- printf("%25s", record.mname[x]);
- printf("%24s", record.lname[x]);
- printf("%21s", record.password[x]);
- printf("%20s", record.dob[x]);
- printf("%17d", record.male[x]);
- printf("%11d", record.female[x]);
- printf("%20s", record.username[x]);
- printf("\n\n");
- }
- printf("\n\n\n\n\n\n\n\n");
- printf("WHAT WOULD YOU LIKE TO DO: \n\n");
- printf(" 1] ADD EMPLOYEE\n");
- printf(" 2] REMOVE EMPLOYEE\n");
- printf(" 3] EXIT\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- /*IF DATABASE IS FULL USER HAS TO DELETE RECORDS TO PROCEED*/
- if (choice == 1)
- {
- if (workerCNT == 99)
- {
- printf("EMPLOYEE DATABASE IS FULL, DELETE A RECORD TO CONTINUE.");
- sleep(2);
- printf("resetting..");
- sleep(3);
- break;
- }
- printf("\n\n");
- printf("ENTER EMPLOYEE ID: ");
- scanf("%s", container);
- for (x=0;x<workerCNT;x++)
- {
- if (strcmp(container,record.username[x]) == 0)
- {
- admit =1;
- break;
- }
- else
- admit=0;
- }
- if (admit == 1)
- {
- printf("THAT ID IS ALREADY USED, CANNOT CREATE DUPLICATE IDENTIIERS..");
- sleep(2);
- printf("\n\n");
- printf("TERMINATING..");
- sleep(2);
- break;
- }
- else
- strcpy(record.username[workerCNT],container);
- printf("ENTER EMPLOYEE PASSWORD: ");
- scanf("%s", record.password[workerCNT]);
- printf("\n\n");
- printf(" ENTER EMPLOYEE FIRST NAME: ");
- scanf("%s", record.fname[workerCNT]);
- printf("\n");
- printf(" ENTER EMPLOYEE MIDDLE NAME: ");
- scanf("%s", record.mname[workerCNT]);
- printf("\n");
- printf(" ENTER EMPLOYEE LAST NAME: ");
- scanf("%s", record.lname[workerCNT]);
- printf("\n\n");
- printf(" ENTER EMPLOYEE D.O.B (dd/mm/yyyy): ");
- scanf("%s", record.dob[workerCNT]);
- printf("\n WHAT IS THE EMPLOYEE's GENDER: \n");
- printf(" 1] MALE\n");
- printf(" 2] FEMALE\n\n");
- printf(" Choice: ");
- scanf("%d", &record.gender);
- if (record.gender != 2)
- {
- record.male[workerCNT] = 1;
- record.female[workerCNT] = 0;
- }
- if (record.gender == 2)
- {
- record.male[workerCNT] = 0;
- record.female[workerCNT] = 1;
- }
- workerCNT++;
- printf("\n\n\n\n");
- printf("EMPLOYEE SUCCESSFULLY ADDED.");
- sleep(3);
- }
- if (choice == 2)
- {
- printf("\n\n");
- printf("ENTER EMPLOYEE ID TO REMOVE: ");
- scanf("%s", record.deleteID);
- for (x=0;x<100;x++)
- {
- if (strcmp(record.deleteID,record.username[x]) == 0)
- {
- admit = 1;
- y=x;
- break;
- }
- else
- {
- admit = 0;
- }
- }
- if (admit == 1)
- {
- strcpy(record.username[x],"\0");
- strcpy(record.password[x],"\0");
- strcpy(record.fname[x],"\0");
- strcpy(record.mname[x],"\0");
- strcpy(record.lname[x],"\0");
- strcpy(record.dob[x],"\0");
- for (x=y;x<workerCNT;x++)
- {
- strcpy(record.username[x],record.username[x+1]);
- strcpy(record.password[x],record.password[x+1]);
- strcpy(record.fname[x],record.fname[x+1]);
- strcpy(record.mname[x],record.mname[x+1]);
- strcpy(record.lname[x],record.lname[x+1]);
- strcpy(record.dob[x],record.dob[x+1]);
- record.male[x] = record.male[x+1];
- record.female[x] = record.female[x+1];
- }//<-- LOOP TO REMOVE EMPLOYEE
- printf("*****************************\n");
- printf("EMPLOYEE SUCCESSFULLY REMOVED\n");
- printf("*****************************\n\n");
- workerCNT--;
- sleep(3);
- }
- else
- {
- printf("ID WAS NOT FOUND IN THE DATABASE.\nresetting..");
- sleep(3);
- }
- }
- if (choice == 3)
- break;
- }
- }
- if (choice == 6)
- {
- printf("\n\n");
- printf("ENTER NEW ADMIN ID: ");
- scanf("%s", adminusername);
- printf("\n\nSUCCESSFUL");
- sleep(2);
- }
- if (choice == 7)
- {
- printf("ENTER CURRENT ADMIN PASSWORD: ");
- scanf("%s", testpassword);
- printf("\n\n");
- if (strcmp(testpassword,password) == 0)
- {
- printf(" ENTER NEW ADMIN PASSSWORD: ");
- scanf("%s", adminpassword);
- printf("\n");
- strlen2=strlen(adminpassword);
- printf(" CONFIRM ADMIN PASSWORD: ");
- scanf("%s", confirmpassword);
- while (strlen1 < minlength || strlen2 < minlength || strcmp(adminpassword,confirmpassword) != 0)
- {
- printf("\n\n\n");
- while (strlen1 < minlength)
- {
- printf(" THE ADMIN ID IS TOO SHORT..\n");
- printf(" RE-ENTER: ");
- scanf("%s", adminusername);
- printf("\n\n");
- strlen1=strlen(adminusername);
- }
- while (strlen2 < minlength)
- {
- printf(" THE PASSWORD LENGTH IS TOO SHORT..\n");
- printf(" RE-ENTER: ");
- scanf("%s", adminpassword);
- printf("\n\n");
- strlen2=strlen(adminpassword);
- printf(" ENTER CONFIRMATION PASSWORD: ");
- scanf("%s", confirmpassword);
- }
- if (strcmp(adminpassword,confirmpassword) != 0)
- {
- printf("\n\n");
- printf(" THE PASSWORD AND CONFIRMATION PASSWORD DO NOT MATCH..\n");
- sleep(2);
- printf(" RE-ENTER PASSWORD: ");
- scanf("%s", adminpassword);
- printf("\n\n");
- strlen2=strlen(adminpassword);
- printf(" ENTER CONFIRMATION PASSWORD: ");
- scanf("%s", confirmpassword);
- }
- }
- printf("\n\n\n");
- printf("*****************************\n");
- printf("PASSWORD CHANGED SUCCESSFULLY\n");
- printf("*****************************\n\n\n");
- sleep(4);
- }
- }
- }
- }
- }
- if (choice == 1)
- {
- printf("\n\n\n\n");
- printf("ENTER ID: ");
- scanf("%s", username);
- for(x=0;x<100;x++)
- {
- if (strcmp(username,record.username[x]) == 0)
- {
- admit = 1;
- currentlogin = x;
- break;
- }
- else
- admit = 0;
- }
- if (admit==0)
- {
- printf("\n\n\n");
- printf("ID NOT FOUND IN THE DATABASE..\n");
- sleep(3);
- printf("resetting..");
- sleep(3);
- }
- if (admit == 1)
- {
- printf("ENTER PASSWORD: ");
- scanf("%s", testpassword);
- if (strcmp(testpassword,record.password[currentlogin]) == 0)
- {
- printf("\n\n\n");
- printf ("****************\n");
- printf ("LOGIN SUCCESSFUL\n");
- printf ("****************\n\n");
- sleep(3);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- while (choice != 7)
- {
- choice = 0;
- printf(" *****************\n");
- printf(" CHENG'S INVENTORY\n");
- printf(" *****************\n\n");
- printf ("Logged in as: ");
- printf ("%s", record.username[currentlogin]);
- printf("\n");
- printf("Enter the number beside the desired choice\n\n");
- printf("1] Display Inventory\n");
- printf("2] Add item in inventory\n");
- printf("3] Remove item in inventory\n");
- printf("4] Edit item in inventory\n");
- printf("5] Item Search\n");
- printf("6] Boot POS\n");
- printf("7] Save changes and Log Off\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- printf("\n\n\n\n\n\n");
- /*Display Inventory*/
- if (choice == 1)
- {
- choice=0;
- if(itemCNT == 0)
- {
- printf("\n\n No items to display...");
- sleep(3);
- }
- else
- {
- printf("\n\n\n\n\n");
- inventoryprint();
- }
- }
- /*Add item in inventory*/
- if (choice == 2)
- {
- additem();
- }
- /*Remove item in inventory*/
- if (choice == 3)
- {
- choice = 0;
- while (choice != 3)
- {
- printf("What would you like to do: \n\n");
- printf(" 1] Lessen Item Quantity\n");
- printf(" 2] Complete Item Removal\n");
- printf(" 3] Exit\n\n");
- printf ("Choice: ");
- scanf("%d", &choice);
- if (choice == 3)
- break;
- else
- {
- printf("Contact the administrator in order to continue.\n\n");
- printf(" ENTER ADMINISTRATOR PASSWORD: ");
- scanf("%s", testpassword);
- if (strcmp(testpassword,adminpassword) == 0)
- {
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- printf("\n");
- printf("SUCCESSFUL");
- printf("\n\n\n\n\n");
- if (choice == 1)
- {
- while(choice != 2)
- {
- inventoryprint();
- for (a=0;a<itemCNT;a++)
- {
- inventory.totalprofit = inventory.totalprofit + inventory.profit_loss[a];
- inventory.asset = inventory.asset + (inventory.bp[a]*inventory.stock[a]);
- }
- inventory.networth = inventory.networth + (inventory.asset + inventory.totalprofit);
- printf("\n\n\n\nTOTAL PROFIT = $");
- printf("%.2f", inventory.totalprofit);
- printf("\n\nTOTAL ASSETS = $");
- printf("%.2f", inventory.asset);
- printf("\n\nNET WORTH = $");
- printf("%.2f", inventory.networth);
- printf("\n\n\n\n\n");
- if (choice == 1)
- {
- while(choice == 1)
- {
- printf("ENTER ID# OF THE ITEM TO LESSEN THE QUANTITY OF: ");
- scanf("%d", &b);
- for(a=0;a<x;a++)
- {
- if(a == b)
- {
- admit = 1;
- y=a;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- inventoryprint();
- printf("\n\n\n\n");
- printf("Lower the stock quantity by: ");
- scanf("%f", &floatcontainer);
- printf("\n\n\n");
- printf("Paass this item as sopilt: \n\n");
- printf(" 1] Yes\n");
- printf(" 2] No\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- if (choice==1)
- {
- inventory.spoiltquantity[a] = inventory.spoiltquantity[a] + floatcontainer;
- }
- inventory.stock[a] = inventory.stock[a] - floatcontainer;
- inventory.profit_loss[a] = ((inventory.sp[a]-inventory.bp[a])*inventory.sold[a]) - inventory.spoiltloss[a];
- printf("\n\n\n\n\n");
- printf("OK.\n");
- sleep(3);
- }
- else
- {
- printf("\n\n\n\n");
- printf("ITEM NOT FOUND..");
- sleep(3);
- printf("\n\n\n");
- }
- printf("\n\n\n\n\n");
- printf("Continue? Enter '1' for yes and '2' for no: ");
- scanf("%d", &choice);
- printf("\n\n\n\n\n\n\n\n\n");
- if (choice == 2)
- {
- printf("resetting..\n\n\n\n\n");
- sleep(2);
- break;
- }
- }
- }
- if (choice == 2)
- {
- choice = 0;
- break;
- }
- }
- }
- if (choice == 2)
- {
- inventoryprint();
- choice = 0;
- while (choice != 2)
- {
- printf("ENTER THE ID# OF THE ITEM TO REMOVE: ");
- scanf("%d", &b);
- for(a=0;a<x;a++)
- {
- if(a == b)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- inventory.stock[a]=0;
- inventory.bp[a]=0;
- inventory.sp[a]=0;
- inventory.sold[a]=0;
- inventory.spoiltquantity[a]=0;
- strcpy(inventory.itemname[a],"\0");
- inventory.spoiltloss[a]=0;
- inventory.profit_loss[a]=0;
- for (b=a;b<y;b++)
- {
- strcpy(inventory.itemname[b],"\n");
- inventory.bp[b] = inventory.bp[b+1];
- inventory.sp[b] = inventory.sp[b+1];
- inventory.sold[b] = inventory.sold[b+1];
- inventory.spoiltquantity[b] = inventory.spoiltquantity[b+1];
- inventory.spoiltloss[b] = inventory.spoiltloss[b+1];
- inventory.profit_loss[b] = inventory.profit_loss[b+1];
- }
- itemCNT--;
- printf("\n\n\n\n\n");
- printf("ITEM SUCCESSFULLY REMOVED.\n");
- sleep(3);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- }
- else
- {
- printf("\n\n\n\n");
- printf("ITEM NOT FOUND..");
- sleep(3);
- }
- printf("\n\n\n\n\n");
- printf("Continue? Enter '1' for yes and '2' for no: ");
- scanf("%d", &choice);
- printf("\n\n\n\n\n\n\n\n\n");
- if (choice == 2)
- {
- choice = 0;
- printf("resetting..\n");
- sleep(2);
- break;
- }
- }
- }
- }
- else
- {
- printf("\n\n\n\n\n");
- printf("INCORRECT ADMINISTRATOR PASSWORD");
- sleep(3);
- printf("\nresetting..");
- sleep(2);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- break;
- }
- }
- }
- }
- if (choice == 4)
- {
- choice=0;
- printf("Contact Administrator to gain access.\n");
- printf("PASSWORD: ");
- scanf("%s", testpassword);
- if (strcmp(testpassword,password) == 0)
- {
- edititem();
- }
- else
- {
- printf("\n\n\nINCORRECT PASSWORD");
- sleep(2);
- printf("resetting..");
- sleep(2);
- }
- }
- /*Item Search*/
- if (choice == 5)
- {
- choice=0;
- printf("\n\n\n");
- printf("Enter item name: ");
- scanf("%s", container);
- for (a=0;a<itemCNT;a++)
- {
- if (strcmp(container,inventory.itemname[a]) == 0)
- {
- admit = 1;
- break;
- }
- else
- {
- admit = 0;
- }
- }
- if (admit == 1)
- {
- printf("\n\n");
- printf("ITEM FOUND\n\n");
- printf("\n\n\n\n\n");
- printf("***********************************************************************************************************************************************************************\n");
- printf("| ID# | ITEM | STOCK | BUYING PRICE | SELLING PRICE | SOLD | SPOILT QNTY | SPOILT LOSS | PROFIT/LOSS |\n");
- printf("***********************************************************************************************************************************************************************\n\n");
- printf("%4d", a);
- printf("%26s", inventory.itemname[a]);
- printf("%15.1f", inventory.stock[a]);
- printf("%15.2f", inventory.bp[a]);
- printf("%17.2f", inventory.sp[a]);
- printf("%16.1f", inventory.sold[a]);
- printf("%17.1f", inventory.spoiltquantity[a]);
- printf("%19.2f", inventory.spoiltloss[a]);
- printf("%29.2f", inventory.profit_loss[a]);
- sleep(3);
- printf("\n\n\n\n\n\n\n\n\n\n\nEnter anything to exit..");
- char input[1];
- scanf("%s",input);
- }
- else
- {
- printf("ITEM NOT FOUND..\n\n");
- }
- }
- /*Start POS*/
- if (choice == 6)
- {
- choice=0;
- while(choice != 2)
- {
- printf("\n\n\n\n");
- printf("*************\n");
- printf("POINT OF SALE\n");
- printf("*************\n\n\n");
- printf(" ****\n");
- printf(" MENU\n");
- printf(" ****\n\n");
- printf(" 1] Start New Transaction\n");
- printf(" 2] Exit\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- sleep(2);
- /*NEW TRANSACTION*/
- if(choice == 1)
- {
- posCNT=0;
- pos.subtotal = 0;
- pos.total = 0;
- pos.transaction++;
- printf("\n\n");
- for(x=0;x<1000;x++)
- {
- choice = 0;
- if (x==0)
- {
- printf("*******************************************************************************\n");
- printf("| ITEM# | ITEM | UNIT PRICE | QUANTITY | COST |\n");
- printf("*******************************************************************************\n\n");
- printf("\n\n\n\n\n\n");
- printf("\n\n TAX = ");
- printf("%.4f", pos.tax);
- printf("\n");
- printf(" SUBTOTAL = ");
- printf("%.2f", pos.subtotal);
- printf("\n");
- printf(" TOTAL = ");
- printf("%.2f", pos.total);
- printf("\n\n\n\n\n\n\n\n");
- }
- printf("\n\n\n\nSelect Choice: \n\n");
- printf("1]Add Item\n");
- printf("2]Remove item\n");
- printf("3]End transaction\n\n");
- printf("Choice: ");
- scanf("%d", &choice);
- if (choice == 1)
- {
- printf(" Enter item name: ");
- scanf("%s", container);
- for (a=0;a<y;a++)
- {
- if (strcmp(container,pos.itemname[a]) == 0)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- printf("\n\n");
- printf("NO DUPLICATE ITEM NAMES PLEASE.\n");
- x=x-1;
- sleep(2);
- }
- else/*ITEM DOES NOT DUPLICATE*/
- {
- strcpy(pos.itemname[x],container);
- for(z=0;z<10000;z++)
- {
- if(strcmp(pos.itemname[x],inventory.itemname[z]) == 0)
- {
- pos.sp[x] = inventory.sp[z];
- pos.pricenotax = (pos.sp[x] * pos.quantity[x]);
- pos.price[x] = pos.sp[x]*pos.quantity[x];
- pos.subtotal = pos.subtotal + pos.price[x];
- break;
- }
- if(z==9999)
- {
- printf (" Item not found in the inventory, manually set its unit price: ");
- scanf ("%f", &pos.sp[x]);
- pos.price[x] = pos.sp[x]*pos.quantity[x];
- pos.subtotal = pos.subtotal + pos.price[x];
- printf ("\n\n");
- }
- }
- printf(" Enter item quantity: ");
- scanf("%f", &floatcontainer);
- /*QUANTITY IS GREATER THAN STOCK AVALIABLE*/
- if ((strcmp(pos.itemname[x],inventory.itemname[z]) == 0) && floatcontainer > inventory.stock[a])
- {
- admit = 1;
- }
- else
- admit = 0;
- if (admit == 1)
- {
- while (floatcontainer > inventory.stock[z])
- {
- printf("\n\nERROR: QUANTITY IS GREATER THAN STOCK AVALIABLE\n");
- printf("Re-Enter Quantity: ");
- scanf("%f", &floatcontainer);
- if (floatcontainer < inventory.stock[z])
- {
- admit=0;
- break;
- }
- }
- }
- else
- {
- pos.quantity[x] = floatcontainer;
- }
- posCNT++;
- }
- }
- if(choice==2)
- {
- printf("Enter the item number of the item which is to be removed: ");
- scanf("%d", &idno);
- printf("\n\n\n");
- for (a=0;a<x;a++)
- {
- if (a==idno)
- {
- admit = 1;
- break;
- }
- else
- admit = 0;
- }
- if (admit == 1)
- {
- strcpy(pos.itemname[a],"\0");
- pos.sp[a] = 0;
- pos.quantity[a] = 0;
- for (b=a;b<x;b++)
- {
- strcpy(pos.itemname[b],pos.itemname[b+1]);
- pos.sp[b] = pos.sp[b+1];
- pos.quantity[b] = pos.quantity[b+1];
- pos.price[b] = pos.price[b+1];
- }
- pos.subtotal = pos.subtotal - pos.price[a];
- posCNT--;
- printf("ITEM SUCCESSFULLY REMOVED.\n");
- sleep(3);
- x--;
- printf("resetting..");
- sleep(2);
- }
- else
- {
- printf("ITEM NUMBER NOT FOUND..");
- sleep(2);
- printf("\nresetting..");
- sleep(1);
- x--;
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- }
- }
- pos.price[y] = pos.sp[y]*pos.quantity[y];
- pos.quantity[x] = floatcontainer;
- printf("\n\n\nTRANSACTION NUMBER: ");
- printf("%d", pos.transaction);
- printf("\n\n");
- printf("*******************************************************************************\n");
- printf("| ITEM# | ITEM | UNIT PRICE | QUANTITY | COST |\n");
- printf("*******************************************************************************\n\n");
- for(y=0;y<=x;y++)
- {
- printf("%6d", y);
- printf ("%20s", pos.itemname[y]);
- printf ("%15.2f", pos.sp[y]);
- printf ("%18.1f", pos.quantity[y]);
- printf ("%17.2f", pos.price[y] = pos.sp[y]*pos.quantity[y]);
- printf ("\n\n");
- }
- pos.subtotal = 0;
- for (a=0;a<posCNT;a++)
- {
- pos.subtotal = pos.subtotal + pos.price[a];
- }
- printf("\n\n\n\n\n");
- printf("\n\nTAX = ");
- printf("%.4f", pos.tax);
- printf("\n");
- printf("SUBTOTAL = $");
- printf("%.2f", pos.subtotal);
- printf("\n");
- printf("TOTAL = $");
- pos.total = pos.subtotal + (pos.subtotal*pos.tax);
- printf("%.2f", pos.total);
- if(choice==3)
- {
- pos.total = pos.subtotal + (pos.subtotal*pos.tax);
- printf("\n\n\n\n\n");
- printf("\n\nTAX = ");
- printf("%.4f", pos.tax);
- printf("\n");
- printf("SUBTOTAL = $");
- printf("%.2f", pos.subtotal);
- printf("\n");
- printf("TOTAL = $");
- printf("%.2f", pos.total);
- printf("\n\n\n\n");
- printf("\n\n\nEnter Cash Tendered: $");
- scanf("%f", &pos.cashtendered);
- printf("\n\n\n");
- if (pos.cashtendered<pos.total)
- {
- printf("Cash tendered is insufficient to complete the transaction. It will not be accounted for. Enter '1' to re-enter and '2' to quit: ");
- scanf("%d", &choice);
- if(choice==2)
- {
- choice=0;
- break;
- }
- }
- while (pos.cashtendered<pos.total)
- {
- choice=0;
- printf("\n\n\n\n\n");
- printf("\n\nTAX = ");
- printf("%.4f", pos.tax);
- printf("\n");
- printf("SUBTOTAL = $");
- printf("%.2f", pos.subtotal);
- printf("\n");
- printf("TOTAL = $");
- printf("%.2f", pos.total);
- printf("\n\n\n\n");
- choice=0;
- printf("\n\n\nRenter Cash Tendered: $");
- scanf("%f", &pos.cashtendered);
- if (pos.cashtendered<pos.total)
- {
- printf("Cash tendered is insufficient to complete the transaction. It will not be accounted for. Enter '1' to re-enter and '2' to quit: ");
- scanf("%d", &choice);
- if(choice==2)
- {
- choice=0;
- break;
- }
- }
- }
- if(pos.cashtendered >= pos.total)
- {
- pos.change = pos.cashtendered - pos.total;
- printf("\n\n\n\n");
- printf("\n\nTAX = ");
- printf("%.4f", pos.tax);
- printf("\n");
- printf("SUBTOTAL = $");
- printf("%.2f", pos.subtotal);
- printf("\n");
- printf("TOTAL = $");
- printf("%.2f", pos.total);
- printf("\n\n");
- printf("Cash Tendered: $");
- printf("%.2f", pos.cashtendered);
- printf("\n");
- printf("Change due: $");
- printf("%.2f", pos.change);
- for (b=0;b<10000;b++)
- {
- for (a=0;a<1000;a++)
- {
- if (strcmp(pos.itemname[a],inventory.itemname[b]) == 0)
- {
- inventory.stock[b] = inventory.stock[b] - pos.quantity[a];
- inventory.sold[b] = inventory.sold[b] + pos.quantity[a];
- }
- }
- }
- printf("\n\n\n Have a nice day!!!");
- for(a=0;a<x;a++)
- {
- strcpy(pos.itemname[a],"");
- }
- sleep(3);
- printf("\n\n\n\n\n\n\n\n\n\n\nEnter anything to exit..");
- char input[1];
- scanf("%s",input);
- if (strcmp(input,"") != 0)
- break;
- }
- }
- }
- }
- }
- }
- if (choice == 7)
- {
- printf("\n\n\n");
- printf("LOGGING OFF...");
- sleep(3);
- break;
- }
- printf("\n\n\n\n\n\n");
- }
- }
- else
- {
- printf("\n\n\n");
- printf("INCORRECT PASSWORD.\nresetting..");
- sleep(3);
- for (y=0;y<3000;y++)
- {
- printf("\n\n\n\n\n\n\n\n\n");
- }
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement