Guest User

Untitled

a guest
Jun 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <windows.h>
  5. #include "bars2.h"
  6.  
  7. char username[50], letter[4]={'0'}, mainswitch[4] ={'0'};
  8. int checksum = 0, leave = 0;
  9.  
  10. void close();
  11.  
  12. main(){
  13. char ;
  14. int login;
  15. //Welcome page
  16. for (login = 0; login < 2; login++){
  17. printf(" Welcome To My World %s""\n", username);
  18. printf(" SlipLine Ind. ""\n");
  19. printf("\n\n\n\n");
  20. if (login < 1){
  21. printf(" Please Login\n");
  22. printf(" User Name: ");
  23. scanf("%s", username);
  24. flushall();
  25. system("cls");
  26. }
  27. }
  28. printf(" Preparing the System");
  29. //end of welcome
  30. //wait for small time
  31. Sleep(2 * 1000);
  32. //progress Bar
  33. progress(2);
  34. //starting other stuff
  35. while(1){
  36. system("pause");
  37. system("cls");
  38. printf(" Welcome %s What would you like to do today?\n", username);
  39. printf(" 1. Add some numbers together\n");
  40. printf(" 2. Subtract some numbers\n");
  41. printf(" 3. Prefom an equation\n");
  42. printf(" 4. Random number generator\n");
  43. printf(" 9. Crash the computer\n");
  44. printf(" E. exit program\n");
  45. if (fgets(mainswitch, 4, stdin) == NULL)
  46. break;
  47. printf("char: '%c'", mainswitch[0]);
  48. switch(mainswitch[0]){
  49. case '1': printf("in 1"); break;
  50. case '2': printf("in 2"); break;
  51. case '3': printf("in 3"); break;
  52. case '4': printf("in 4"); break;
  53. case '9': printf("in 9"); break;
  54. case 'e': case 'E':{
  55. close();
  56. }break;
  57. default: printf("in default"); break;
  58. }
  59. //system("cls");
  60. }
  61. system("pause");
  62. }
  63.  
  64. void close(){
  65. printf(" Are you sure you wish to Exit (y/n): ");
  66. while(leave != 1){
  67. if (fgets(letter, 4, stdin) != NULL){
  68. switch(letter[0]){
  69. case 'y': case 'Y': progress(3); leave = 1; break;
  70. case 'n': case 'N':{
  71. return;
  72. }break;
  73. default: {
  74. printf("Im sorry try again");
  75. Sleep(1 * 1000);
  76. system("cls");
  77. printf(" Are you sure you wish to Exit (y/n): ");
  78. }
  79. }
  80. }
  81. }
  82.  
  83. }
Add Comment
Please, Sign In to add comment