Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <windows.h>
  4. #include <locale.h>
  5.  
  6. struct dados{
  7.  
  8. char nome[50];
  9. int idade;
  10. int telefone;
  11. char email[50];
  12. int cpf;
  13. };
  14.  
  15. void coletaDados(struct dados *pInfo);
  16. void limparTela();
  17. void abertura();
  18. void menuPrincipal(int *cliente);
  19. void dadosBancarios();
  20.  
  21. int main(){
  22. setlocale(LC_ALL, "Portuguese");
  23.  
  24. int menu;
  25. int cliente;
  26. int sim;
  27. struct dados info, *pInfo;
  28. pInfo = &info;
  29.  
  30.  
  31. do{
  32. abertura();
  33. menuPrincipal(&cliente);
  34.  
  35. if(cliente == 1){
  36. dadosBancarios();
  37.  
  38. }
  39.  
  40. else if(cliente == 2)
  41. coletaDados(&info);
  42.  
  43.  
  44. }while(menu == 3);
  45.  
  46.  
  47. return 0;
  48. }
  49.  
  50. void abertura(){
  51.  
  52. printf("\n\n\n\n\n\n\n\n\n\t\t\t******************************\n");
  53. printf("\t\t\t*****[Bem-Vindo ao banco]*****\n");
  54. printf("\t\t\t**********[LOCKED]************\n");
  55. printf("\t\t\t******************************\n");
  56. Sleep(3000);
  57. limparTela();
  58. }
  59.  
  60. void menuPrincipal(int *cliente){
  61.  
  62. printf("Para onde deseja prosseguir?\n\n");
  63. printf("->[1]Já sou cliente\n");
  64. printf("->[2]Não sou cliente\n\n");
  65. printf("Digite o número escolhido e pressione ENTER: ");
  66. scanf("%d", cliente);
  67.  
  68. }
  69.  
  70. void coletaDados(struct dados *pInfo){
  71.  
  72.  
  73. printf("Nome: ");
  74. scanf(" %[^\n]s", pInfo->nome);
  75.  
  76. printf("Idade: ");
  77. scanf(" %d", &pInfo->idade);
  78.  
  79. printf("Telefone: ");
  80. scanf(" %d", &pInfo->telefone);
  81.  
  82. printf("Email: ");
  83. scanf(" %s", pInfo->email);
  84.  
  85. printf("CPF: ");
  86. scanf(" %d", &pInfo->cpf);
  87.  
  88. }
  89. void dadosBancarios(){
  90.  
  91. int e1;
  92.  
  93. printf("Oque deseja fazer?\n\n");
  94. printf("->[1]Checar saldo\n");
  95. printf("->[2]Efetuar deposito\n");
  96. printf("->[3]Efetuar saque\n\n");
  97. printf("Digite o numero escolhido e pressione ENTER: ");
  98. scanf("%d", &e1);
  99.  
  100. switch(e1){
  101.  
  102. case 1: printf("1");
  103. break;
  104. case 2: printf("1");
  105. break;
  106. case 3: printf("1");
  107. break;
  108. default: printf("Comando inválido!");
  109. break;
  110.  
  111.  
  112. }
  113.  
  114. }
  115.  
  116. void limparTela(){
  117.  
  118.  
  119. COORD coord;
  120. DWORD written;
  121. CONSOLE_SCREEN_BUFFER_INFO limpo;
  122.  
  123. coord.X = 0;
  124. coord.Y = 0;
  125. GetConsoleScreenBufferInfo ( GetStdHandle ( STD_OUTPUT_HANDLE ), &limpo );
  126. FillConsoleOutputCharacter ( GetStdHandle ( STD_OUTPUT_HANDLE ), ' ',
  127. limpo.dwSize.X * limpo.dwSize.Y, coord, &written );
  128. SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
  129. return;
  130. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement